In this discussion, We will introduce about the use of <th> tag in html5. This <th> tag is used for defining the table headers of cells or columns in a table. The<th> tag is used within the <tr> tag and <tr> is nested in <table> tag. This tag must have opening and closing tags. The header will shown in bold font style in the html table.
The declaration of this tag is as:
|<th> Column Header </th>|
This tag have four specific attributes are as following:
colspan="value" The value of this attribute specify the no of columns to be spanned and must be a non negative integer.
rowspan="value" The value of this attribute specify the no of rows to be spanned and must be a non negative integer.
headers="value" The value of this attribute specify space saprated list of header for <th> element .
scope="value" The value of this attribute specify that the which cells use <th> header information. The values are as:
row, col, rowgroup, colgroup etc.
<title>Example of th tag</title>
<body>Example of th tag.<p>
Difference between html4.01 and html5.
Most of the html4.01 attributes are not supported by html5.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.