I've seen thead
,tbody
,but never see tfoot
before today!
views:
44answers:
3well, according to google ;) see for instance http://www.htmlcodetutorial.com/tables/_THEAD.html here, tfoot is used for the summarization on the bottom of the table.
tfoot
is a valid HTML element, though rarely used. It is supported by all browsers. Here's a related compatibility table.
See 11.2.3 Row groups: the THEAD, TFOOT, and TBODY elements in the w3c spec.
Important point from the spec:
TFOOT must appear before TBODY within a TABLE definition so that user agents can render the foot before receiving all of the (potentially numerous) rows of data.
tfoot is defined to be always at the bottom of the table, no matter where in the table you place it. It is meant to be used as some sort of summary that can be displayed even when a big table is still loading. A table layout should look like this:
<table>
<thead>
<tr>
<th>header</th>
</tr>
</thead>
<tfoot>
<tr>
<td>Total: foo</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>data</td>
</tr>
[...]
</tbody>
</table>
Ofc except for some CMS systems noone uses the tables this way (as they were intended).