Connected: An Internet Encyclopedia
4.9. Table Head, Foot and Body Elements

Up: Connected: An Internet Encyclopedia
Up: Requests For Comments
Up: RFC 1942
Up: 4. A walk through the Table DTD
Prev: 4.8. The COL Element
Next: 4.10. Table Row (TR) elements

4.9. Table Head, Foot and Body Elements

4.9. Table Head, Foot and Body Elements

   <!ELEMENT thead - O tr+>
   <!ELEMENT tfoot - O tr+>
   <!ELEMENT tbody O O tr+>

   <!ATTLIST (thead|tbody|tfoot)      -- table section --
           %attrs;                    -- id, lang, dir and class --
           %cell.halign;              -- horizontal alignment in --
                                      -- cells --
           %cell.valign;              -- vertical alignment in cells --
           >

Tables may be divided up into head and body sections. The THEAD and TFOOT elements are optional, but one or more TBODY elements are always required. If the table only consists of a TBODY section, the TBODY start and end tags may be omitted, as the parser can infer them. If a THEAD element is present, the THEAD start tag is required, but the end tag can be omitted, provided a TFOOT or TBODY start tag follows. The same applies to TFOOT.

Note: This definition provides compatibility with tables created for the older model, as well as allowing the end tags for THEAD, TFOOT and TBODY to be omitted.

The THEAD, TFOOT and TBODY elements provide a convenient means for controlling rendering. If the table has a large number of rows in the body, user agents may choose to use a scrolling region for the table body sections. When rendering to a paged device, tables will often have to be broken across page boundaries. The THEAD, TFOOT and TBODY elements allow the user agent to repeat the table foot at the bottom of the current page, and then the table head at the top of the new page before continuing on with the table body.

TFOOT is placed before the TBODY in the markup sequence, so that browsers can render the foot before receiving all of the table data. This is useful when very long tables are rendered with scrolling body sections, or for paged output, involving breaking the table over many pages.

Each THEAD, TFOOT and TBODY element must contain one or more TR elements.

ID, CLASS, LANG and DIR
See earlier description of common attributes.

ALIGN, CHAR, CHAROFF and VALIGN
Specify values for horizontal and vertical alignment within table cells. See inheritance order of alignment properties.


Next: 4.10. Table Row (TR) elements

Connected: An Internet Encyclopedia
4.9. Table Head, Foot and Body Elements