HTML5 <th> Tag


A simple HTML table with two header cells and two data cells:

<th>Header 1</th>
<th>Header 2</th>
<td>Data 1</td>
<td>Data 2</td>
Code it Online »

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 a th element is often bold and centered.

The text in a td element is often left-aligned.

Differences Between HTML 4.01 and HTML5

Some HTML 4.01 attributes are not supported in HTML5.


Attribute Value Description
abbr text Not supported in HTML5
align left
Not supported in HTML5
axis category_name Not supported in HTML5
char character Not supported in HTML5
charoff number Not supported in HTML5
colspan number Indicates the number of columns this cell should span
headers header_cells'_id A space-separated list of cell IDs that supply header information for the cell. This attribute allows text-only browsers to render the header information for a given cell
height pixels
Not supported in HTML5
nowrap nowrap Not supported in HTML5
rowspan number Indicates the number of rows this cell should span
scope col
Specifies the scope (which cells the table header applies to) of the table header
valign top
Not supported in HTML5
width pixels
Not supported in HTML5

Standard Attributes

The <th> tag also supports the Standard Attributes in HTML5.

Event Attributes

The <th> tag also supports the Event Attributes in HTML5.

Have Any Suggestion? We Are Waiting To Hear from YOU!

Your Query was successfully sent!