When Tables are Just Tables

By Deane Barker on March 10, 2006

Here’s another argument for CSS-based, table-less design that I haven’t heard before: by not using tables for layout, then you know that a table is, in fact, a table intended for the display of tabular data.

Yesterday, a client of mine wanted to insert a table into the description of one of their products. They did this through eZ publish’s WYSIWYG editor, but they weren’t happy with how it looked. They wanted it formatted up all nice with borders and a header row and everything.

My first instinct was, how do I isolate just those tables that are meant to display tablular data? I started looking through the code to figure out where in the layout the table would appear so I could isolate it, etc.

Then I realized: I have no tables in the entire site. Everything is in a positioned DIV. This means that I could style tables globally without regard to breaking anything else on the page.

I had a field day for 10 minutes after that, styling up TABLE, TD, and TH tags to make a neat, orderly table layout. My tables are single-purpose now — I know that if there’s a table in the page, it’s meant to look like I styled it up.