Live data from Hacker News

The Anti-Hero of CSS Layout – “display:table” (2014)

colintoh.com

51–60 of 60 posts

Re: The Anti-Hero of CSS Layout – “display:table” (2014)

#51
post #26

Earlier quoted context omitted.

On the other hand, there are cases where HTML Tables put great challanges to user experience. First to come to mind: A table with many rows displayed on a tiny mobile screen. The most common solution is to let the table overflow horizontally. There are other complex solutions, most of them fall in the CSS-Hack category. In this case, to have a CSS table that can be something else on a tiny screen (via media queries)…

But you don't choose between HTML tables and CSS tables - they are independent concerns, HTML is semantics, CSS is presentation. HTML table elements just have display:table as the default style (in the default browser style sheet). You can override this in a style sheet as with any other style. And conversely, you can apply display:table to any element regardless of HTML semantics. It is true older browsers had parti…

> But I believe this is not an issue in modern browsers.

I think the last browser that saw widespread use in any market with that issue was NN4. In some markets, Opera [some version; 7?] with the same issue will have been a problem much later than NN4. Really, this is to say: this hasn't been a concern for well over a decade at this point even with fairly generous browser support matrices.

Re: The Anti-Hero of CSS Layout – “display:table” (2014)

#52

Earlier quoted context omitted.

What audience is that? Who are these people relevant to? Microsoft isn't holding back anything, they can't force these people to update their software. If everyone keeps supporting them, they never will have a reason to update.

Government is one such audience. The K-12 system is another.

Is that really true? You'd think that the government has security provisions that requires software updates.

As for K-12, is that really a requirement in some places, or is it just the case that some clients just happen to not be updated?

Re: The Anti-Hero of CSS Layout – “display:table” (2014)

#53

Earlier quoted context omitted.

Government is one such audience. The K-12 system is another.

Is that really true? You'd think that the government has security provisions that requires software updates. As for K-12, is that really a requirement in some places, or is it just the case that some clients just happen to not be updated?

IE9 gets security updates on Vista SP2.

More generally IE9 and IE10 are both still supported by Microsoft (for Vista SP2, Server 2008 SP, Server 2008 IA64; and for Server 2012, and Embedded 8 Standard), so it seems entirely plausible Microsoft would sell security updates for other OSes to clients willing to pay for them; they definitely do that for some clients (some still get security updates for XP!).

Re: The Anti-Hero of CSS Layout – “display:table” (2014)

#54
post #49
post #2

It is fascinating how a perfectly sensible rule-of-thumb "you shouldn't use html tables for something which is not semantically a table" gradually morphed into various superstitions like "you shouldn't use html tables" or "you shouldn't use tables for layout" or even "you shouldn't use tables". I don't think people have a hard time understanding that you shouldn't use the -element for something which is not a quote.…

> It is fascinating how a perfectly sensible rule-of-thumb "you shouldn't use html tables for something which is not semantically a table" gradually morphed into various superstitions like "you shouldn't use html tables" or "you shouldn't use tables for layout" or even "you shouldn't use tables". It's always bugged me to see the great lengths people will go to to avoid using an HTML table to create things like a cale…

I think many people is confused by "semantically a table" because they think of a table as a certain visual representation of data, which also how the word is often used.

The semantic definition of table in HTML is a bit more subtle - it is a set of data structured in two dimensions. (Like how the days in a monthly calendar is grouped by week (horizontally) and by day-of-week (vertically)).

Re: The Anti-Hero of CSS Layout – “display:table” (2014)

#55
post #48
post #44

Earlier quoted context omitted.

Ah OK, I agree this would be useful. I think a newer CSS proposal factors the display property into separate values to declare element flow and element content flow independently.

"a newer CSS proposal" This is of 2002: http://www.w3.org/TR/2002/WD-css3-box-20021024/#L706 15 years ago, Carl!

Yeah, that draft was abandoned though, but some of the ideas have been incorporated in the CSS3 display model.

Re: The Anti-Hero of CSS Layout – “display:table” (2014)

#56
post #2

It is fascinating how a perfectly sensible rule-of-thumb "you shouldn't use html tables for something which is not semantically a table" gradually morphed into various superstitions like "you shouldn't use html tables" or "you shouldn't use tables for layout" or even "you shouldn't use tables". I don't think people have a hard time understanding that you shouldn't use the -element for something which is not a quote.…

Largely because I'm relatively new to all of this and probably don't know better, but I've found success just using divs for all layout and doing it myself. Which is a smell to me, but I just can't help but find that every time I have consistent results and expected behaviour. Div and flexbox for everything. It actually reminds me of another smell I have with django: write my own serializers and views rather than usi…

Other elements besides div just have a different default style. These default can be overridden in CSS. If you would like to start with a "blank slate" where all elements have the same defaults, you can use a CSS reset. There is really no good reason to not use the semantic elements when appropriate.

Re: The Anti-Hero of CSS Layout – “display:table” (2014)

#57
post #20

Earlier quoted context omitted.

In terms of results, responsiveness, and flexibility, doing it with a div (or some other block-level element) and flexbox is the best way to do it. In terms of standards and tabular data, doing it with a table is probably more correct, but I think the benefits of flexbox outweighs any concerns about that.

>In terms of standards and tabular data, doing it with a table is probably more correct I haven't tested it, but I assume you could fake the semantic part of a "CSS table" with something like `role=grid`

Yeah but why not just use HTML tables? It simpler and easier and more correct.

Re: The Anti-Hero of CSS Layout – “display:table” (2014)

#58
post #57

Earlier quoted context omitted.

>In terms of standards and tabular data, doing it with a table is probably more correct I haven't tested it, but I assume you could fake the semantic part of a "CSS table" with something like `role=grid`

Yeah but why not just use HTML tables? It simpler and easier and more correct.

Because HTML table elements are treated differently by assistive technologies.

Re: The Anti-Hero of CSS Layout – “display:table” (2014)

#59
post #24

Earlier quoted context omitted.

Largely because I'm relatively new to all of this and probably don't know better, but I've found success just using divs for all layout and doing it myself. Which is a smell to me, but I just can't help but find that every time I have consistent results and expected behaviour. Div and flexbox for everything. It actually reminds me of another smell I have with django: write my own serializers and views rather than usi…

You're very lucky to be new to this! If you have success with div and flexbox for everything, then I'm guessing you're not supporting old IEs. You're lucky to have skipped the years of pain in which flexbox simply wasn't an option (for many devs that have to support IE it's still not).

But what's the current day scenario when you have to support old IEs? Security updates are only being provided for IE 11, which hopefully makes it default to the corporate sphere.

Re: The Anti-Hero of CSS Layout – “display:table” (2014)

#60

Earlier quoted context omitted.

Is that really true? You'd think that the government has security provisions that requires software updates. As for K-12, is that really a requirement in some places, or is it just the case that some clients just happen to not be updated?

IE9 gets security updates on Vista SP2. More generally IE9 and IE10 are both still supported by Microsoft (for Vista SP2, Server 2008 SP, Server 2008 IA64; and for Server 2012, and Embedded 8 Standard), so it seems entirely plausible Microsoft would sell security updates for other OSes to clients willing to pay for them; they definitely do that for some clients (some still get security updates for XP!).

These outdated OSes have a tiny market share, and more importantly, an organization that prevents sw installation doesn't use outdated OSes. Others can install Firefox even on XP. Old Androids and IPhones are a bigger issue.
Post reply on HN