Do you know the TFoot tag, the tfoot tag, the tfoot tag...

Interestingly enough, I actually learned something about HTML today. Yep, good ole HTML, just when I think I know you, you go and throw me a curveball. Well okay, perhaps it's not quite so dramatic, but it's an interesting little tidbit of information none the less.

Basically, we all know tables have rows and cells, which appear as:

<table>
<tr>
<td>
</td>
</tr>
</table>


However, did you know that there are some other mysterious table tags, thead/th, tfoot, and tbody? Perhaps you've seen tbody floating around here and there, probably even th/thead. However, the part that I actually find interesting is the tfoot tag. In your HTML structure it would be laid out like this:


<table>
<thead>
<tr>
<td>
</td>
</tr>
</thead>
<tfoot>
<tr>
<td>
</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>
</td>
</tr>
</tbody>
</table>


Now here's where the interesting part comes in - the tfoot section is actually rendered BEFORE the tbody section, but below it in the page. This is possibly an interesting reference to the early days of the web when text actually took time to load over our 14.4 k modems, and table based layout was the norm. Who knows... (certainly not me).

Of course the real lesson to be learned here is that we should all love CSS, because tables are CRAZY.

0 comments:

Post a Comment