Recently I had a conversation with a web developer who had never used HTML tables. They’d come into the business after the web standards movement had established itself and had never learnt to use tables. As a consequence they were using divs and CSS floats, etc. to lay out things that could (or even should) have been done with tables and running into the sort of issues you might expect when you use a generic tool to do a specialised job.
So I was wondering if there were other people like this out there, and if so would they benefit from a short tutorial explaining HTML tables from a CSS perspective? Such a tutorial might prove useful for others as well – it might provide an alternative way of approaching the tables-to-CSS transition that some people are still struggling with, and it might help explain just how CSS and tables interact. After all the table elements have their own layout model in the CSS specification and it’s not the easiest thing to grasp.
If I were to write such a tutorial I guess it would fall into two halves. The first half would look at the “simple” table model (
th elements) used for simple data tables and *gasp* layout tables and how their default behaviour compares with the standard CSS box model; whilst the second half would look at the “advanced” table model (
thead/tbody/tfoot plus the accessibility enhancing attributes) and how to build complex data tables.
Anyone interested in seeing this?