←back to thread

197 points OuterVale | 7 comments | | HN request time: 1.121s | source | bottom
Show context
anonymars ◴[] No.46227939[source]
I will never understand the bizarre scene of the web's smug collective declaration that tables were dead and not to be used juxtaposed against the years it took to regain the ability to reliably center things. Assuming one agrees that we even did regain it.

Related: I also love when I can't paste tabular data into Excel/etc. anymore

For the record, I don't hate the idea of stylesheets, but...sheesh

replies(11): >>46227986 #>>46228033 #>>46228508 #>>46228913 #>>46228936 #>>46228943 #>>46229276 #>>46229933 #>>46230316 #>>46230586 #>>46232156 #
1. Angostura ◴[] No.46230316[source]
> Related: I also love when I can't paste tabular data into Excel/etc. anymore

Except that’s exactly where tables should be used. So if you can’t, someone has really misunderstood CSS.

Use it for tables, not for layout.

replies(2): >>46231522 #>>46248039 #
2. wanderingstan ◴[] No.46231522[source]
I’ve gotten in several arguments over the years where webdevs insisted on showing tabular data using flexbox or hardcoded div widths or worse. They insisted that html tables were never ever to be used and couldn’t be persuaded.
replies(3): >>46231713 #>>46232019 #>>46234182 #
3. MrJohz ◴[] No.46231713[source]
In fairness, the default `display: table` setup is often a pain to work with, so I can understand why people would opt for flexbox instead. One better option, though, might be to use `table` elements under the hood, styled with `display: grid` (and judicious use of subgrid for the intermediate elements) to get more precise control over the layout, while still using the right semantic elements underneath.
4. idbehold ◴[] No.46232019[source]
If you try to render tables with millions of cells the browser does a really poor job and the performance is abysmal. The only solution when you need to render that many cells is to virtualize the table and only have the visible cells (plus some buffer) actually in the DOM at a time. That plus weird restrictions browsers put on certain table elements (looking at you thead) that prevent them from being "sticky" headers means that the developer is left with absolutely positioned divs as the only solution. Blame browser vendors for not providing a native way to present tabular data with more than a few hundred thousand rows without causing performance issues.
replies(1): >>46234081 #
5. pornel ◴[] No.46234081{3}[source]
there's table-layout:fixed that makes rendering of large tables much faster.

I'd argue that if you have so many rows that DOM can't handle, humans won't either. Then you need search, filtering, data exports, not JS attaching a faked scrollbar to millions of rows.

6. pornel ◴[] No.46234182[source]
They are wrong, and didn't get the point of separating semantics and presentation.
7. Rendello ◴[] No.46248039[source]
I agree, but it is funny to me that your Hacker News comment is itself a table. It's in the same vein as "don't freak out, but there's a spooky skeleton inside you!"