HTML <th> Tag

❮ Previous Reference Next ❯


    <td>Table data</td>
    <td>Table data</td>
    <td>Foot data</td>
    <td>Foot data</td>


The <th> element specifies a header cell in a table. The element should occur within a table row as defined by a <tr>tr element.

The difference between <th> element and <td> is that browsers might render table headers slightly differently, usually bolding and centering contents.

The element is logical in nature and should be used to structure tables.


Version: HTML 3.2, 4, 4.01, 5

Standard Syntax


Browser Support



Attribute Value Description
abbr text Specifies a short abbreviation of the cell's content.
colspan number This attribute gives the number of columns respectively that the cell is to span.
headers headerId The value of this attribute must have the value of an id attribute of the th element that is targeted.
rowspan number Specifies the number of rows respectively that the cell is to span.
scope col
Specifies whether a header cell is a header for a column, row, or group of columns or rows

Global Attributes

The <th> element also supports the Global Attributes in HTML.

Event Attributes

The <th> element also supports the Event Attributes in HTML.

By Default CSS Value(s)

Most of the browsers will display the <th> element with the following by default value(s)

th {
  display: table-cell;
  vertical-align: inherit;
  font-weight: bold;
  text-align: center;
❮ Previous Reference Next ❯