3 ms·
This site sums it up pretty concisely: http://phrogz.net/CSS/WhyTablesAreBadForLayout.html http://phrogz.net/CSS/WhyTablesAreBadForLayout.html Not that I agre
by ggchappell 16y ago
This site sums it up pretty concisely:
http://phrogz.net/CSS/WhyTablesAreBadForLayout.html http://phrogz.net/CSS/WhyTablesAreBadForLayout.html
Not that I agree with him entirely. In particular:
> 6. Once you know CSS, table-based layouts usually take more time to implement.
For a sizable site with layouts reused over multiple pages, yes. For a single page, or a site with differing layouts for each page, in my experience, no. Actually, I'd extend that first sentence of mine into a new reason: with CSS you can specify your layout once, and not have to redo it for every page. Doesn't work with tables.
> 7. Tables are semantically incorrect markup for layout.
My response: So what? (Yes, I know about the problems with screen readers, but that's a different reason, one I happen to agree with.)
And then, on the other hand, there are the things no one wants to say: the advantages tables have over CSS. In particular, it's obvious to me that CSS was not designed with modern layouts in mind. The fact that it works at all is really just an accident: it turned out that you can make columns using floats (how 'bout that?). Yes, using tables for layout is a kind of jury-rig, but to be honest, so is using CSS. And at least tables have a mechanism for producing columns, that was designed with columns in mind.
And then there are the browser rendering inconsistencies. With modern browsers, these problems are fading, but for older ones, the inconsistencies with CSS seem to be much more troublesome than those with tables.
- rimantas 16y agoAnd then, on the other hand, there are the things no one wants to say: the advantages tables have over CSS. In particular, it's obvious to me that CSS was not designed with modern layouts in mind. The fact that it works at all is really just an accident: it turned out that you can make columns using floats (how 'bout that?). Oh, come on. If some are still stuck with IE6 this does not mean that CSS is only capable that much. Time to learn some modern CSS, folks (hint: IE8+ supports display: table-*). And anyone who thinks that tables are easier to deal with either did not work enough with CSS or did not care enough. In 1996-2003 I was building stuff tables way, in 2004 I went full CSS and never looked back.
- hyperlexic 16y agoIE6 still has a surprisingly large user base according to my analytics reports. some of my clients' sites are seeing above 30% still using IE6. hopefully IT departments will go to windows 7 or something, because seriously - what year is this?
- ggchappell 16y ago> And anyone who thinks that tables are easier to deal with either did not work enough with CSS or did not care enough. Probably both, in my case. :-)
- anthonycerra 16y agoHey thanks for the link and your thoughtful response.