tags:

views:

44

answers:

3

I've seen thead,tbody,but never see tfoot before today!

A: 

well, 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.

Bullet Tooth Tony
+2  A: 

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.

Pekka
+1  A: 

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).

dbemerlin
I think it is also supposed to be repeated (or floated or scrolled) if the table doesn't fit on the screen (or a page, when printing), so that you can always see it, even if the bottom of the table is off screen or on another page.
Jörg W Mittag