Hacker News new | ask | show | jobs
by olavk 5525 days ago
> PS: tables are still bad.

Tables are not bad.

CSS purists state that using table markup purely for layout purposes (e.g. for positioning a page footer) is bad, because it violates the separation between content and presentation. In that case display:table-* will give you the same layout (neither worse nor better!) but without requiring any specific markup in the html.

But this poses a dilemma for web developers, because display:table-* is not supported by all browsers, so some specifc kinds of layout can only be achieved with table markup.

Developers had to choose between (1) compromising the layout (2) compromising the semantic/style separation or (3) use complex workaround like the CSS frameworks, which tried to emulate the table-layout model without requiring display:table support in the browser. Neither is optimal.

1 comments

I think you're misremembering history. It's not bad because 'it violates the separation between content and presentation', it's bad because you end up with tag soup. The table's demise was purely that it was too hard to maintain in anything more than a trivial layout. When you started getting down to your third nested table it was a friggin' nightmare. Also cells and rows had weird quirks as well as missing properties where you'd then have to nest a span in every cell just to get it behaving properly. Oh and also the occasional sacrifice to the dark god of 'table-layout:fixed'.

The rest of it though I agree with you.

But I think we agree. Layouts with nested tables are hard to maintain because presentational concerns (like the attributes which defines cell sizes) is spread all over the document and intermingled with the content. It's a mess.