THEAD - Table Head

Syntax <THEAD>...</THEAD>
Attribute Specifications
  • ALIGN=[ left | center | right | justify | char ] (horizontal alignment of cells in group)
  • CHAR= (alignment character for cells)
  • CHAROFF= (alignment character offset)
  • VALIGN=[ top | middle | bottom | baseline ] (vertical alignment of cells in group)
Contents One or more elements
Contained in

The THEAD element defines a group of header rows in a table. A may have one THEAD, which must follow any , , or elements, and precede the optional and required elements.

By explicitly grouping header rows with THEAD, authors give browsers the ability to include the header rows on each page of a printed, multi-page table, as well as the ability to present a long table with a scrolling body and static header rows. While few browsers currently support THEAD, it can be used with no harm on non-supporting browsers.

The following example uses THEAD to group the two header rows of a table:

<TABLE SUMMARY="This table gives the character entity reference,
                decimal character reference, and hexadecimal character
                reference for 8-bit Latin-1 characters, as well as the
                rendering of each in your browser.">
  <COLGROUP>
  <COLGROUP SPAN=3>
  <COLGROUP SPAN=3>
  <THEAD>
    <TR>
      <TH SCOPE=col ROWSPAN=2>Character</TH>
      <TH SCOPE=col ROWSPAN=2>Entity</TH>
      <TH SCOPE=col ROWSPAN=2>Decimal</TH>
      <TH SCOPE=col ROWSPAN=2>Hex</TH>
      <TH SCOPE=colgroup COLSPAN=3>Rendering in Your Browser</TH>
    </TR>
    <TR>
      <TH SCOPE=col>Entity</TH>
      <TH SCOPE=col>Decimal</TH>
      <TH SCOPE=col>Hex</TH>
    </TR>
  </THEAD>
  <TBODY>
    <TR>
      <TD SCOPE=row>non-breaking space</TD>
      <TD>&amp;nbsp;</TD>
      <TD>&amp;#160;</TD>
      <TD>&amp;#xA0;</TD>
      <TD>&nbsp;</TD>
      <TD>&#160;</TD>
      <TD>&#xA0;</TD>
    </TR>
    ...
  </TBODY>
</TABLE>

In addition to the , THEAD takes presentational attributes for specifying the alignment of cell data. Since few browsers support THEAD, authors may wish to specify these attributes on the , , or elements instead.

The ALIGN attribute specifies the horizontal alignment for each cell in the row group. Possible values are left, center, right, justify, and char. ALIGN=char aligns a cell's contents on the character given in the CHAR attribute. The default value for the CHAR attribute is the decimal point of the current language--a period in English. The CHAROFF attribute specifies the offset to the first occurrence of the alignment character. The attribute's value is a number in pixels or a percentage of the cell's width; CHAROFF="50%" centers the alignment character horizontally in a cell.

The VALIGN attribute specifies the vertical position of a cell's contents. Possible values are:

More Information