th tag

<th> (Table Heading Tag)

Explanation

TH tag denotes the header cells in a table i.e. the title portion.
It displays the text enclosed by <th> in bold font and aligns centre.
<table border = "Value"> <tr> <th>Text</th> </tr> </table>
Normally, there are two types of cells available in a table. They are "Header and Standard Cell".
1] Header Cells are created by <th>. It owns header information.
2] Standard Cells are created by <td>. It has general information.
Element Specific attributes supported by this tag are:
AttributeValueDescription
colspan number Groups the cells from the specified number of columns into a sole cell.
headers header_id Denotes the multiple header cells to which the cell is related to.
rowspan number Combines the cells from the specified number of rows into an individual cell.
scope col, colgroup, row, rowgroup Denotes the header cell acts as header for column, row or group of columns or row.

Example Code:

Result :

Internet Explorer Chrome Firefox Opera
Popular Browser Well Known Browser Most Used Browser Reliable Browser

  • It must be placed inside the <tr> and </tr> should be placed inside the <table>.
  • It is one among the "Table Elements" in HTML5.
It is available in the previous versions of HTML.
It supports both Global Attributes and Event Attributes in HTML5.

Limitations:

It will function in all the major browsers.

Ask Questions

Ask Question