HTML <th> tag
Updated: 10/11/2017 by Computer Hope
When writing in HTML, the <th> tag is used to designate a cell that is a header for a group of cells within a table. It is useful for storing information about a set of rows or columns. The following sections contain information about the <th> tag, including an example of it in use, as well as related attributes and browser compatibility.
Tip: More advanced tables may also include the <caption>, <col>, <colgroup>, <tbody>, <tfoot>, or <thead> elements.
<table class="mtable2 tab">
We have added a few of our own classes to the table using CSS; this action allows us to improve its appearance.
Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows all of the current unique HTML attributes for the <th> tag, as well as a description of each.
||Designates an abbreviated version of the content within a header cell
||Designates how man columns a header cell should span
||Designates one or more header cells to which a certain cell has relation
||Designates how man rows a header cell should span
||Designates whether a header cell is a header for a column, row, or group of columns or rows
||Designates the sorting direction of a column
A deprecated attribute is one that may function currently but is not supported in going forward. While the attribute may work with the current version of HTML, it will eventually be phased out. It is better to avoid using these attributes to help future-proof your website.
||Designates the alignment of content inside an element
||Used to categorize header cells
||Designates the background color of a header cell
||Aligns the content in a header cell to a specific character
||Sets the number of characters to offset the content from the character designated by the char attribute
||Designates the height of a header cell
||Designates that the content inside a header cell should not wrap
||Alights the content in a header cell vertically
||Designates the width of a header cell
<table>, <td>, <tr>, Browser, Cell, Class, Column, Compatibility, Format, Row, Table, Web design terms