### The THEAD, TFOOT, and TBODY elements

Attributes defined elsewhere

- id, class (document-wide identifiers)

- lang (language information), dir (text direction)

- title (element title)

- style (inline style information )

- onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup (intrinsic events )

- align, char, charoff, valign (cell alignment)

Table rows may be grouped into a table head, table foot, and one or more table body sections, using the THEAD, TFOOT and TBODY elements, respectively. This division enables user agents to support scrolling of table bodies independently of the table head and foot. When long tables are printed, the table head and foot information may be repeated on each page that contains table data.

The table head and table foot should contain information about the table's columns. The table body should contain rows of table data.

When present, each THEAD, TFOOT, and TBODY contains a row group. Each row group must contain at least one row, defined by the TR element.

This example illustrates the order and structure of table heads, feet, and bodies.

    <TABLE>
    <THEAD>
         <TR> ...header information...
    </THEAD>
    <TFOOT>
         <TR> ...footer information...
    </TFOOT>
    <TBODY>
         <TR> ...first row of block one data...
         <TR> ...second row of block one data...
    </TBODY>
    <TBODY>
         <TR> ...first row of block two data...
         <TR> ...second row of block two data...
         <TR> ...third row of block two data...
    </TBODY>
    </TABLE>

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. The following summarizes which tags are required and which may be omitted:

- The TBODY start tag is always required except when the table contains only one table body and no table head or foot sections. The TBODY end tag may always be safely omitted.

- The start tags for THEAD and TFOOT are required when the table head and foot sections are present respectively, but the corresponding end tags may always be safely omitted.

Conforming user agent parsers must obey these rules for reasons of backward compatibility.

The table of the previous example could be shortened by removing certain end tags, as in:

    <TABLE>
    <THEAD>
         <TR> ...header information...
    <TFOOT>
         <TR> ...footer information...
    <TBODY>
         <TR> ...first row of block one data...
         <TR> ...second row of block one data...
    <TBODY>
         <TR> ...first row of block two data...
         <TR> ...second row of block two data...
         <TR> ...third row of block two data...
    </TABLE>

The THEAD, TFOOT, and TBODY sections must contain the same number of columns.