News for hackers. Stuff that matters.
Re:The Anti-hero of CSS Layout – “display:table” by igvadaimon on Monday October 27, 2014 @07:28AM (#8514861)
What I didn't understand from this blog post is WHY display:table is really bad.
Re:The Anti-hero of CSS Layout – “display:table” by pornel on Monday October 27, 2014 @07:46AM (#8514921)
It's not. That's the point.

"Tables for layout are bad" applies only to use of <table> HTML markup for layout. `display:table` achieves the same layout, but without presentational markup and accessibility problems that html-tables-for-layout caused.

If it was called "display:stretchy-box", nobody would mind.

Re:The Anti-hero of CSS Layout – “display:table” by adamtj on Monday October 27, 2014 @10:14AM (#8515515)
Are html-tables bad even for their intended purpose of laying out tabular data?
Re:The Anti-hero of CSS Layout – “display:table” by jerf on Monday October 27, 2014 @10:23AM (#8515565)
No.

And again, that's part of the point; "HTML table tags aren't good for layout" semantically collapsed[1] to "tables aren't good for layout" collapsed to "tables are bad" collapsed to "tables are EVIL". No, they aren't. The first collapse is easily explained by the fact that for a long time HTML table tags bidirectionally implied table layout (no way to have one without the other), but now that CSS has broken that in both directions it's not a valid simplification.

(Less well known aspect of CSS table support, I'm pretty sure it's possible to take a series of HTML table elements and "undo" their tableness if you're feeling feisty. But it's a weird way to do things.)

[1]: I seem to recall there's a term for what I'm reaching for. Much obliged if someone can remind me.

Re:The Anti-hero of CSS Layout – “display:table” by pbhjpbhj on Monday October 27, 2014 @10:41AM (#8515678)
>"for a long time HTML table tags bidirectionally implied table layout" //

You're right, tables are fine for tabular data. But it was always thus.

Perhaps if you were a html noob and hung out listening to people pissed off with table layouts you'd get confused and think all tables were bad (you definitely want a graphical layout helper app though as keeping track of them in code is a PITA).

It was

    table tage |- table layout V tabulated data
rather than just

    table tage |- table layout
Re:The Anti-hero of CSS Layout – “display:table” by nitrogen on Monday October 27, 2014 @12:31PM (#8516495)
I've worked on HTML that was written by someone who cargo culted all of the tables into rows of Bootstrap columns, for tabular data. It happens.
Re:The Anti-hero of CSS Layout – “display:table” by jeremyswank on Monday October 27, 2014 @11:39AM (#8516136)
"I seem to recall there's a term for what I'm reaching for." Conflated?
Re:The Anti-hero of CSS Layout – “display:table” by jerf on Monday October 27, 2014 @04:46PM (#8518081)
Specifically, a complicated concept getting simplified to a simpler concept that is easier to spread around culturally. Complicated treatises on when tables are and are not valid are much harder to spread around than "Tables are EVIL!", so the latter has a significant memetic propagation advantage.

The fact that nobody has popped up so far suggests that I may be wrong about an existing term. I'd really have expected a LessWronger or something to speak up by now.

Re:The Anti-hero of CSS Layout – “display:table” by namsterdamus on Monday October 27, 2014 @01:22PM (#8516796)
Well with the world moving towards mobile display compatibility people are generally depreciating tables in favor of grid-systems via CSS because they are more customizable for formatting tables intelligibly on smaller displays. Tables don't collapse or reformat properly on small screen and what you'll get is usually multiple columns with one letter on each line while grid-systems can stack columns making it both more legible and organized. CSS grid-systems of course require more work but you can generally find them already integrated into frameworks like bootstrap. Even still if you have complex table formats it'll require more customized situational grids than generalized grid-systems but in most cases bootstrap grids works fine. However I have had times when I have tables with minimum copy and mostly icons so we opted for tables because even on small displays it collapsed just fine as opposed to grids which left a lot of empty space.
Re:The Anti-hero of CSS Layout – “display:table” by Leszek on Monday October 27, 2014 @09:36AM (#8515340)
Or "display:flexible-box", maybe even shortening that somehow. Hmm.
Re:The Anti-hero of CSS Layout – “display:table” by wavefunction on Monday October 27, 2014 @05:12PM (#8518215)
A flex-box container is pretty different than a table.

Flex-boxes have a major axis whereas tables are just rows and columns, as one specific difference.

Re:The Anti-hero of CSS Layout – “display:table” by Leszek on Monday October 27, 2014 @05:22PM (#8518268)
Yeah, fair point actually.
Re:The Anti-hero of CSS Layout – “display:table” by mattmanser on Monday October 27, 2014 @07:52AM (#8514943)
That's not what he's saying. He's saying they're good at times but he took ages to realize that because the old table based layout using <table> used to result in extreme tag soup.

If you are looking for reasons why they're actually not that great anyway, this succinct post on /r/webdev reminded me why I haven't unsubbed from that highly variable sub:

http://www.reddit.com/r/webdev/comments/2k8ud2/why_does_no_o...

In this case, the example the OP gave at the beginning, a dashboard, can't work with a responsive layout using display:table, which is a feature you'd kinda expect in this day and age.

So they finally release a half decent display:table and it's too late as we now need responsive designs.

Pretty much sums up how pants the W3C process is.

Re:The Anti-hero of CSS Layout – “display:table” by joshuacc on Monday October 27, 2014 @11:47AM (#8516192)
> So they finally release a half decent display:table and it's too late as we now need responsive designs.

I'm not sure what you mean by "finally release." The display: table property was part of the CSS 2.1, which became a Candidate Recommendation in 2004 and an official Recommendation in 2011. It also works perfectly in IE8, which was released in 2009.

The term "Responsive Design," on the other hand, wasn't even coined until 2010, and didn't really become mainstream for another 2-3 years.

There were a couple of years when working with display: table was perfectly reasonable and the "Responsive Design" trend hadn't yet hit the tipping point.

I dislike overdone/late W3C processes as much as anyone, but this isn't a good example of that.

Re:The Anti-hero of CSS Layout – “display:table” by gsnedders on Monday October 27, 2014 @01:09PM (#8516716)
Even earlier, display: table was part of the original CSS Level 2 which became a REC in 1998 — twelve years before "responsive design" came into being. It largely followed what had been added to HTML 3.2 in January 1997 — based on what most browsers (with Netscape first) in 1996.

There's also a lot of unwillingness to do much around display: table — it remains largely unspecified (mostly because we basically know web compatibility requires you to do what IE6 does — and nobody knows quite what that is, and MS people have struggled to get permission to disclose the detail).

Re:The Anti-hero of CSS Layout – “display:table” by yuhong on Tuesday October 28, 2014 @12:42AM (#8519567)
At least it was mostly copied from Netscape, and source for that is available as Mozilla Classic (from the cancelled Mariner project). I used it to figure out where HTML legacy color parsing come from.
Re:The Anti-hero of CSS Layout – “display:table” by gsnedders on Tuesday October 28, 2014 @01:57PM (#8522368)
Sadly, we know that what web compat relies on isn't quite what NN4(-ish) does, so the mere fact that that is available doesn't really help too much. :(
Re:The Anti-hero of CSS Layout – “display:table” by yuhong on Tuesday October 28, 2014 @02:06PM (#8522442)
Actually, the same thing is true for HTML legacy color parsing too, but the only difference there is a few lines of code. I think it is these lines that was added (from http://mxr.mozilla.org/classic/source/lib/layout/layimage.c#...):

  if (bytes_per_val > 4)
  {
        bytes_per_val = 4;
  }
Re:The Anti-hero of CSS Layout – “display:table” by gsnedders on Tuesday October 28, 2014 @02:25PM (#8522571)
Table parsing is nowhere near that similar. It's almost certain IE's algorithm is largely different — it just obtains similar results to NN's in most cases.
Re:The Anti-hero of CSS Layout – “display:table” by yuhong on Tuesday October 28, 2014 @12:52AM (#8519594)
But yea, I have been thinking of the idea of a IE only shared source program for a while now.
Re:The Anti-hero of CSS Layout – “display:table” by ZeroGravitas on Monday October 27, 2014 @09:53AM (#8515412)
It's not. But nobody ever got to use it, because IE6 and IE7 didn't support it, and now it's only useful for supporting IE8, IE9.
Re:The Anti-hero of CSS Layout – “display:table” by icantthinkofone on Monday October 27, 2014 @08:03AM (#8514987)
He mentions it in the article. People associated it with the HTML table element. Using the table element for page layout affected the document's structure which is why that's a bad thing but the CSS table property does not affect structure.