4 ms·
Why wouldn't you use proper tables for tables?
by SahAssar 9y ago
Why wouldn't you use proper tables for tables?
- throwaway66666 9y agotables are evil /s
- ben_jones 9y agoBulk table rendering can have a performance impact on your app and a more minimal implementation may be desired
- SahAssar 9y agoThen the fix is to only render the rows currently in the viewport, right? Seems weird to recreate tables using CSS for that reason.
- _sdegutis 9y agoDunno why you’re downvoted. Noticed this too, if you have a table with slow loading content then the whole thing doesn’t render until all of it can render.
- tuespetre 9y agoInteresting, does `table-layout: fixed` have any effect?
- rehemiau 9y ago+1 There are many problems with html tables (like inconsistent buggy implementations between browsers) but grids don't fix them and introduce other problems. You can't group cells in rows / columns html elements. You can't write a simple css selector for a particular cell. You can't easily refer to a whole row with a css selector. You can't do stuff like "highlight the whole row on hover" because you wouldn't have a parent element to select. Grids are for grid layouts, and with current feature set they can't replace tables.
- slaymaker1907 9y agoGrids are much easier to do if you want to have smart scaling (i.e. benefits of Flexbox over more traditional layouts).
- brentburg 9y agoExactly! Recreating the visual layout of a table is only half of the problem. You also need to think about making it accessible (which this component does not appear to attempt). You could get the for free by just using the proper semantic element.
- noonespecial 9y agoRuby, Sass, React, yarn, Node... Its like a game of how many dependencies can we require to make a <table>. Seriously though, are we running off the rails here? Are we going back to the bad old days of perl "page generators", just replacing a dozen CPAN commands with a bunch or yarn's, gems, and npm's instead? I'm starting to wonder.