Hacker News new | past | comments | ask | show | jobs | submit login

The "tables vs. CSS" argument has a clear answer and I can't believe we are still arguing about it.

CSS people who argue against tables are obeying their instinct that content and presentation should be separate. They are mostly right about this (I say mostly because the more graphical a webpage is, the more the content and the presentation are inextricably linked).

What the CSS people refuse to acknowledge is that CSS dropped the ball on this, and that CSS failed to incorporate tools for describing layouts in table-based ways. The table-based paradigm is a very natural way to describe layouts -- that's why everyone used tables for this prior to CSS!

Tables are not the enemy! Tables are natural! Tables are expressive! Give me any web page and I'll draw you the lines that show its "table-ness".

If CSS supported tables properly, the web standards people wouldn't have to walk around being enforcers about this. If you could easily convert HTML-based tables to CSS-based tables, everybody could be happy and live in harmony.

The CSS advocates should redirect their ire to the shortcomings of CSS, rather than the people who are working around those shortcomings!




"The table-based paradigm is a very natural way to describe layouts -- that's why everyone used tables for this prior to CSS!"

Wrong and wrong.

Tables for layout didn't really take off until the late 90's, and mostly were popularized by the work of one person (Dave Siegel, who wrote a book where he referred to table-based techniques as part of "third-generation" web design, implying just how much had come before).

And even when they did take off, tables were still burdened with the sorts of quirks and browser incompatibilities people complain about with CSS (remember font-size inheritance? Remember the two different baseline alignment models?); too many people seem to have forgotten all the tricks they had to learn to make those layouts work properly, and how complex the resulting HTML had to be.


> Tables for layout didn't really take off until the late 90's

Which was coincidentally when websites started having sidebars. Are you arguing in favor of pre-1995 web design? Are you arguing that there is a more natural way than tables to express site layouts with sidebars?

When I say "prior to CSS" I mean "prior to wide CSS adoption and browser support". Yes, CSS1 was released in 1996, but it didn't really catch on among web authors for a few years (and wasn't really practical to use anyway due to limited browser support). In that intervening time, websites started sprouting sidebars, and basically all the sites that used sidebars did so with HTML tables.

> And even when they did take off, tables were still burdened with the sorts of quirks and browser incompatibilities people complain about with CSS

Quirks or no, HTML-based tables are more fit for describing layouts than CSS ever will be until web authors can use "display: table" or something like that. With HTML-based tables, you're working around browser quirks (which really aren't as bad as you make them out to be). With CSS, you're working with a language that is too weak (even if implemented perfectly) to express what you're trying to say. With CSS, a three-column layout (something that many, many sites want) is considered a "holy grail" (http://www.alistapart.com/articles/holygrail/).

CSS (pre-"display:table") doesn't have the right abstractions for achieving designers' demonstrated needs. Why do you live in denial of this fact?


> until web authors can use "display: table"

IE8 supports it, so any day now.


The first point is absolutely correct. Nearly every other visual layout system uses grids or stacks. Novices love using Excel for layout. Nevermind computers, look around and you'll find plenty of examples of space organized with grids.

Say what you will about semantic purity yada yada but grids (aka tables) are damn intuitive.


The issue is that they're both flawed solutions and you should pick the solution that's the least worst depending on what you're trying to do. Sometimes that's tables, sometimes that's CSS, sometimes it's some combination of the two. They both have advantages and disadvantages.

Saying "CSS dropped the ball, and that CSS failed to incorporate tools for describing layouts in table-based ways" is an incredibly oversimplified summary. Back in 1996, CSS1 was published and while the styling was incredibly well-thought-out, the layout part of it was somewhat tacked on (somewhat to its detriment), with the aim that CSS2 would tackle the complex layout issues that needed to be addressed. CSS2 was introduced in 1998, except no-one implemented much of it for years, most notably display:table which gets the most of the advantages of using CSS and tables within CSS. Sometime around 2002 or so (after the death of Netscape) someone realised you could hack around with 'float' property (introduced in CSS1 and well-supported) to achieve column-like layouts.

Once IE6 and IE7 dies we can finally switch to display: table. I'll give an optimistic estimate of this happening in 2013, but it really depends on how long XP/Vista last.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: