Live data from Hacker News

CSS Grid – Table layout is back. Be there and be square

developers.google.com

91–100 of 280 posts

Re: CSS Grid – Table layout is back. Be there and be square

#92
post #50

Earlier quoted context omitted.

Except anyone with accessibility requirements, no? As far as I know tables are horrible for anyone with a screen reader. Can you annotate tables somehow to work for accessibility purposes?

The problem with screen readers is summarized "Screen readers assume the content inside a table is tabular". Are divs better just because they are undefined? It seems to me that the problem would more easily be solved by adding some attributes to skip tabular treatment or to add captions, rather than ditching tables altogether. Table elements like could even be used to identify and access parts of the UI pages.

> Screen readers assume the content inside a table is tabular

I'm curious to hear from screen reader users. I recall that the gap between "what web developers think screen readers do" and "what screen readers do" has always been sizable.

Re: CSS Grid – Table layout is back. Be there and be square

#93

Earlier quoted context omitted.

Do you mean literal markup, or tables in CSS such as display: table Using CSS surely can improve the screen reader experience by the markup not being actual tables.

Screen readers haven't been confused by tables since about 1998.

There was a particularly extreme trend back then (well - probably more during the 90s) where websites were mainly big Photoshop images sliced up into a lot of nested tables of dizzying complexity. Screen readers off course struggled with that as it was rather hard to determine the order of the content. I'm not sure how much trouble they have with more minimal use of tables for presentation.

Re: CSS Grid – Table layout is back. Be there and be square

#95
post #57

Maybe I sound like a broken record, but I still don't understand how layout can ever be a style. Why does an HTML -element not exist?

If styles are not for layouting, what are they for? Even font-sizes are layouting, no? You propose just scrapping CSS?

The nice thing about CSS is that you can ignore it in "article view" or mobile. You can't ignore HTML in the same way. Don't you see the value in splitting semantic and styling components of a page?

Re: CSS Grid – Table layout is back. Be there and be square

#96
post #79
post #69

Earlier quoted context omitted.

It's not. There were a few arguments against "table layout", some of which apply to hn as well IMNHO. Added tags without semantic value (just as your div-soup above also illustrates). Layout speed (in reality not much of an issue now - and also an issue with deeply nested tags with complex layout). Both are fixed in modern html5 which moves (back) towards simple, semantic, document layout (html-body-article-heading-e…

I look forward to trying modern flexbox and grid layouts. I have not had the privilege (?) to work with either yet; our customers are not necessarily on the bleeding edge of browser releases so I have to stay a little behind the curve. Hence, a lot of div soup and ridiculous indentation levels. Honestly, for what I'm doing (a pretty complex web app with an almost desktop-style GUI with a bunch of buttons, text inputs…

oh yes! is my nightmare. at least with table u can more easily spot the error when rendered.

> of course a div layout is at least partially semantic

That's contestable, nowadays is absolutely unpredictable, s are more semantic

Sometimes i wish HTML was like python hehe

Re: CSS Grid – Table layout is back. Be there and be square

#97

Earlier quoted context omitted.

We had a simpler standard in 1995. It was called tables and it did this exceptionally well and more importantly was easy enough for even amateurs to understand. And then armchair demagogues decided that markup should no longer be used for markup, setting web layout back decades and creating the field of web designers whose major accomplishment was understanding stupid div hacks.

Your comment is the best example of the demagogue. Zero understanding of the issue, the problems that tables caused. But it was easy, right?

Every time this subject comes up, someone trots out the old canard that tables messed with screen readers and therefore were irretrievably bad.

Or they say from the highest and mightiest and ivoryest pedestal "separation of semantics and display, thus spaketh the lord" pretending, of course, that modern websites look and behave just like documents when that's demonstrably false, and that tables are therefore irretrievably bad.

And instead you now have, 20 years later (TWENTY! YEARS!) something that only now works as well for layout.

Adding "not-data" and navigation directives to tables to aid screen readers and separate semantics would not have taken 20 years.

And now you'll have to wait another 5 years before this new, "just as good as tables!" feature is sufficiently widespread to actually deploy it without a polyfill shim.

But please tell me more about what I do or don't know.

Re: CSS Grid – Table layout is back. Be there and be square

#98
post #60

Earlier quoted context omitted.

That's the problem. This argument was over a decade ago and it's because it's a nightmare to work in tag soup. I still have to deal with tables for layout on mail templates, bloody Outlook, and that extra 2 layers of tag nesting you have to do on every level quickly turns the code into an incomprehensible mess, even with careful indentation. And if you're not very careful with indentation it turns into an utter night…

That's a problem to be sure, but sometimes I wonder if this is much better:

[deleted]

Re: CSS Grid – Table layout is back. Be there and be square

#99
post #45

Earlier quoted context omitted.

Because indicates that it contains tabular data, and implies lots of things about the content that it contains that would be misleading when using table-based layout. And display: table, which uses CSS to make things look the same, without implying anything about the content, wasn't supported by Microsoft, back when they they were a) the only browser that mattered, and b) trying to hold back the web to protect their…

Well the issue of semantics was not exactly solved by turning everything to s. It's still a mess, but a different mess. I would even say it's bad to have display:table-cell because it's reduntant.

If you're using a just so you can lay things out visually, then its lack of semantics is appropriate. Presumably you use artices, headers, paragraphs, asides, links, img, lists etc. within those non-semantic "container" divs to convey the semantics.

I'm not claiming it's perfect, but it's like government data being released as a CSV vs a PDF with a scan of paper document. Structured data is better for lots of reasons, even if it's only minimally structured.

Re: CSS Grid – Table layout is back. Be there and be square

#100

Earlier quoted context omitted.

While that would probably work fine for display and layout, but it doesn't work so well with the semantic document model that the web is built on. For example accessibility would suffer greatly unless every "jquery" (using your analogy) out there were to implement its own accessibility. (That's not to say things are absolutely peachy wrt. accessibility these days, but they'd get a lot worse if everybody had to implem…

I don't know if developers even care about semantic markup anymore, just have your 5 meg of JavaScript squirt out a bundle of divs and to hell with accessibility.

Just render a png file, server side. The only way to ensure pixel perfect layout, and it's even going to use less bandwidth than most JS frameworks these days.
Post reply on HN