NOTICE: This website is no longer updated or supported - as such many of the techniques used to build it may seem antiquated in the modern day. It is preserved for historical reasons only.

HTML XHTML The Complete Reference
home » reference » appendix a » html element reference

<thead> (Table Header)


This element is used to group the rows within the header of a table so that common alignment and style defaults can easily be set for numerous cells. This element might be particularly useful when setting a common head for tables that are dynamically generated.

Standard Syntax


<thead
align="center | char | justify | left | right"
char="character"
charoff="offset"
class="class name(s)"
dir="ltr | rtl"
id="unique alphanumeric identifier"
lang="language code"
style="style information"
title="advisory text"
valign="baseline | bottom | middle | top"

tr elements only
</thead>

Attributes Defined by Internet Explorer


accesskey="key" (5.5)
hidefocus="true | false" (5.5)
language="javascript | jscript | vbs | vbscript" (4)
tabindex="number" (5.5)
unselectable="off | on" (5.5)
valign="center" (4)

Standard Event Attributes


onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup

Events Defined by Internet Explorer


onactivate, onbeforeactivate, onbeforecut, onbeforedeactivate, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresize, onresizeend, onresizestart, onselectstart, ontimeerror

Element Specific Attributes


align
This attribute is used to align the contents of the cells within the <thead> element. Common values are center, justify, left, and right. The HTML 4 specification also defines a value of char. When align is set to char, the attribute char must be present and set to the character to which cells should be aligned. A common use of this approach would be to set cells to align on a decimal point.

char
This attribute is used to define the character to which element contents are aligned when the align attribute is set to the char value.

charoff
This attribute contains an offset as a positive or negative integer to align characters as related to the char value. A value of 2, for example, would align characters in a cell two characters to the right of the character defined by the char attribute.

valign
This attribute is used to set the vertical alignment for the table cells with the <thead> element. HTML 4.01 defines baseline, bottom, middle, and top. Internet Explorer replaces middle with center; the effect should be the same.

Example


<table border="1" bgcolor="yellow" width="80%">
  <thead align="center" bgcolor="red" class="footer"
    valign="bottom">
<td>
This is the Important Table Headline</td>
  </thead>

  <tbody class="tablebody">
<tr>
  <td>
The contents of the table!</td>
</tr>
  </tbody>
</table>

Compatibility


HTML 4, 4.01, XHTML 1.0, 1.1
Internet Explorer 3, 4, 5, 5.5, 6
Netscape 6, 7
Opera 5-7

Notes


This element is contained only by the <table> element and contains table rows as delimited by <tr> elements.

Under the XHTML 1.0 specification, the closing </thead> tag ceases to be optional.

(X)HTML Elements
CSS Properties
Previous: th Next: title
< Home | About | Chapters | Examples | Errata | Reference | Site Map >