Tuesday, June 26, 2012

CSS and the War on Tables

Ok, I'm just gonna come right out and say it: I still use tables.

Not for everything, mind you. There are certainly places where divs work better, and I use them. But I've about had it with the hysterical shrieking about how you must use divs for everything, even if they don't work as well, or the webpage police will haul you off to webpage prison where you will do hard webpage time. Seriously, folks, enough. You can have more than one tool in the toolbox.

CSS has a variety of great and useful tools of which I take advantage on a daily basis. That said, I'm tired of pretending that either of the S's stands for "structure." I'm also tired of pretending that sacrificing two chickens and an Amiga to the God of Floats and Margins while praying that nothing moves by so much as a pixel is a reasonable substitute for the tremendously useful balance between rigidity and elasticity that tables provide.

Separating content from presentation is a great idea. I'm all for it. Structure is neither. It's not that I can't do it with divs. I can. I have. I'm not doing it any more. To do what I need structure-wise with divs, I find that I (and others also from the examples they post) end up building the exact same structure with divs that I used to build with table elements. Which would be fine except that it takes at least three times longer and the result is a fragile animal that lets sections be pushed out of position, breaks if the size of the content changes too much, and requires jumping through all sorts of hoops to have two things next to each other stay the same height. 

I tried drinking the Kool-Aid. I really did. But I sincerely believe that this is one of those cases where the Emperor needs to tell his tailors to settle the f*** down.

2 comments:

  1. What really needs to happen is that CSS needs some actual freaking layout features. It's all fine and good to say that using tables for layout is improper, but if you're going to say that, then *that functionality needs to be available in CSS*. Right now? It's just not there! And to the extent that it is there, it has a fragile and jerry-rigged feel to it. Making a simple three-column layout, for example, just shouldn't be as damn hard as it is in CSS.

    ReplyDelete