Thursday, September 18, 2008

Tables in moderation?

The use of CSS has become integral in the world of web development. The question is, have tables become an underused element in an effort to clean up our markup?

Having worked on a wide variety of projects and collaborated with a number of talented designers, I have come across some complex designs that I believe warranted the use of tables even though they are not being used for tabular data. To me, the decision came down to using javascript with div tags or using a table. For me, it did not make sense to force a div to behave the way I needed it too by using javascript, when tables were already built to behave that way.

The way I see it, HTML provides us with an assortment of elements (DIVs, SPANs, Ps and so on). For this illustration I'd like to refer to them as tools in our belt. A hammer was designed to be used on nails, but there have been many times that I found other uses for the hammer. Am I wrong for doing this?... I think not, as long as I am choosing the best tool for the job at hand. Likewise, it is good to limit the use of tables when laying out a page, but when a job calls for it I don't feel guilty about using a table.

I'd like to here from anyone who either agrees or disagrees. I'd also like to discuss best practice of when and how to use a table.