HTML th Tag

Example

A simple HTML table with two header cells and two data cells:
<table border="1">
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
</table>
Teach Yourself  by BH24 HTML Editor Tool!

The <th> tag is supported in all major browsers.

Definition and Usage

The <th> tag defines a header cell in an HTML table.
An HTML table has two kinds of cells:
  • Header cells - contains header information (created with the <th> element)
  • Standard cells - contains data (created with the <td> element)
The text in <th> elements are bold and centered by default.
The text in <td> elements are regular and left-aligned by default.

Tips and Notes

Tip: Use the colspan and rowspan attribute to let the content span over multiple columns or rows!