HTML Encyclopaedia

The th tag

The <th> tag is used to introduce a table head element. For further discussion and examples see the table entry.

The align attribute may be used with the tag with the effects shown in this table.

HeadingHeadingHeading
Textual Element 1Textual Element 2Textual Element 3

The HTML for the above is

<table border=5>
<tr><th align=left>Heading<th align=center>Heading<th align=right>Heading
<tr><td>Textual Element 1<td>Textual Element 2<td>Textual Element 3
</table>

The <th> tag has almost exactly the same effect as the <td> tag and has the same attributes. The only differences are that, by default,

  1. Text is rendered in a strong or bold style
  2. Items within a <th> cell have the align=center attribute

<th> and <td> cells may be freely mixed, even within the same table row.


See also <tr>, <td>, <table>, <caption>, and the general notes on tables.