Web Authoring Statistics: The table elements

The ninth, tenth, and eleventh most used elements in our sample were table, td, and tr. Table elements:

table, td, tr, tbody, th, col, caption, thead, colgroup, and tfoot.

First, we are a little concerned. In our data sample there were twice as many pages that used the table element but didn't use the td element, than there were pages that used the samp element. For every page that you can find that uses the samp element, we can find two that use the table element in a completely bogus fashion!

Our initial thought was that maybe this was cases like the Geocities footer:


...but that isn't it, because our analysis only counted start tags, not end tags. If someone can explain why so many pages would use a <table> tag and then not put any cells in it, please let us know.

There's not much surprise in the attributes; as we all know, HTML tables are mostly abused for layout purposes, and this is clearly visible in the fact that all but one of the thirty five most commonly used table-related attributes are presentational (well, we could argue that class="", id="", colspan="", and rowspan="" were being used for semantic purposes, but who are we trying to kid here?).

The onmouseover and onmouseout attributes are seen on td elements; in fact the td element is the second most likely element to see these event handler attributes, after a and before img and div.

The count of caption/thead/tfoot elements probably represents the cases of non-presentational tables. The tbody elements are probably mostly from authoring tools that are internally written to support HTML, and therefore output the implied tbody elements explicitly. I have no explanation for the relatively high number of th elements.

Some of the semantic attributes on the table elements are used. The table element sees the summary attribute quite a bit, considering (though we have not checked how many of them simply say "Layout table, two columns, menu in the first column, content in the second" or some such). Also, although it isn't shown on the graphs above, the td element sees the headers, scope and abbr attributes sometimes too (and the last two are also sometimes seen on th as well). There was no measurable use of the axis attribute, though.

Typos were quite common; the td element, for example, had more pages with widht, witdh, aling, valing, with, and heigth attributes than it had pages with headers attributes.

Also common were misplaced attributes; again looking at td we see alt, face, and size attributes (possibly useful on other elements but certainly not td). There were also cases of "What were you thinking?", most notably <td wrap=""> (was nowrap intended?), and <td span=""> (colspan maybe?).