Zen in the Art of CSS
There is more than just a diagnosis of obsessive compulsive disorder when you build according to what is correct. And here comes csszengarden.com with a message filled with the power of cascading style sheets (CSS). I can’t count the times my “uptight” ass was saved from hours of misery because I took the time to centralize my HTML formatting in external CSS files. But csszengarden.com wants to take me to an even higher plane of salvation.
Their implicit message is that using table
elements (td
and th
) instead of div
elements to layout content is wrong. Hey! Tables should be used for (gasp) tabular data! They should not be a foundational element (pun not intended) of visual design. I agree with this but I still use tables. Here’s why:
- Corporate corruption. Most browsers are products of corporations large and small. And these organizations still fail to follow standards to insure that declarations of CSS are obeyed without question. See the CSS Zen Garden resource guide for details.
div
elements stack vertically not* horizontally.* In order to force groups of div blocks to rest side by side (to get, say, that three-column “holy grail” that so popular among Web page designers) you have to do a lot of tricks, including absolute positioning and floating. As of this writing, horizontal groups of block elements are called table cells. So I suggest that the w3c comes out with a new element calleddivgroup
or something to make relative positioning rows ofdiv
elements relatively reliable.- Blocks in
table
elements magnify with more flexibility in FireFox. This is a relatively obscure complaint for people who do not love the zoom command in FireFox. But this problem suggests thatdiv
-based designs are more rigid thantable
-based ones—that more absolutism is required fordiv
-based designs. This is probably not an issue for designers who like to fix font sizes and use a lot of graphics to freeze their design in place.The beauty of csszengarden.com is distracting. I am moved to use the background-image property declaration more often (again, because of corporate corruption, this feature was not supported when it was first introduced). But I am not moved to drop my layout tables. I will have to wait for better corporate support.