<th> Table Header Cell Element - (X)HTML Element Reference :: webDev

<th>

You can use two kinds of table cells: the <td> can be used for any kind of data, while the <th> element is reserved for cells that contain header information. Despite the word “head,” this element isn’t used exclusively for a table heading that appears at the top of a <table>; it can equally be applied to any other cell in a <table>.

The <th> element renders the text content it contains slightly differently from the <td>—in the case of the browsers tested, the rendered style makes the font bold and centered (and this convention is unlikely to change soon). Centered headings are not always desirable, though, and you can use the align attribute to override this (or better still, use CSS to change the alignment).

As a structural element which conveys some orientation information about the data that may follow, the th has some special attributes that reinforce the relationship between header and data cells, namely the axis, headers, id, and scope attributes.

Finally, this element uses the colspan and rowspan attributes when the content of the cell needs to run across multiple columns or rows.

<th> Table Header Cell Element - (X)HTML Element Reference :: webDev