Table Header Cell | Transitional | Strict | |||
th | tags | example | tags | example | |
Must be contained in | <table> | As Transitional | |||
Must contain in opening tag | ---------------------- | ---------------------- | |||
Must not contain in opening tag | name="" |
<table > <tr> <th name="bluecell" > </th> <th > </th> </tr> </table> |
As Transitional | ||
Can contain in opening tag | align="" [Horizontal align] align="left" align="right" align="center" align="justify" __________________ valign="" [Vertical align] valign="top" valign="middle" valign="baseline" valign="bottom" baseline = aligns the cells along the baselines of the text. example __________________ id="" __________________ CELL WIDTH - percentage [%] width="%" __________________ CELL WIDTH - pixels width="" Note: e.g [width="500px"] |
align="left" <table > <tr> <th align="left">text</th> <th> </th> </tr> </table> __________________ valign="top" table > <tr> <th valign="top" >text</th> <th> </th> </tr> </table> _______________ <table > <tr> <th id="bluecell" > </th> <th > </th> </tr> </table> __________________ CELL WIDTH - percentage [%] <table width="100%"> <tr> <th width="50%"> </th> <th width="50%"> </th> </tr> </table> __________________ CELL WIDTH - pixels <table width="200"> <tr> <th width="50"> </th> <th width="50"> </th> </tr> </table> |
As Transitional ______________ As Transitional ______________ As Transitional ______________ Cell width will Fail Strict Validation width="%" ______________ Cell width will Fail Strict Validation |
______________ <table width="100%"> <tr> <th width="50%"> </th> <th width="50%"> </th> </tr> </table> ______________ <table width="200"> <tr> <th width="50"> </th> <th width="50"> </th> </tr> </table> |
|
Must contain between tags | Text or non-breaking space |
<th>Text</th> <th> </th> |
As Transitional | ||
Can contain between tags | |||||
Must not contain between tags | |||||
Must not be contained in | |||||
Can be contained in | |||||
th is used to define a header row within a table. The <th> element is identical to the <td> element except that the text within the <th> element is usually rendered with a bold font and centered within the cell. |