HTML th tag
HTML th element defines a header cell in the heading section of a table.
<table class="demoTable">
<caption>The top populated countries</caption>
<tr>
<th>Countries</th>
<th>Population</th>
<th>Area</th>
<th>Capital</th>
</tr>
<tr>
<td> Philippines </td>
<td> 104,918,090 </td>
<td> 300,000 </td>
<td> Manila </td>
</tr>
<tr>
<td> Mexico </td>
<td> 129,163,276 </td>
<td> 1,964,375 </td>
<td> Mexico City </td>
</tr>
</table>
</>
Countries | Population | Area | Capital |
---|---|---|---|
Philippines | 104,918,090 | 300,000 | Manila |
Mexico | 129,163,276 | 1,964,375 | Mexico City |
table heading is very necessary because it tells us what kind of data is present in the columns.
A table heading can contain more than one rows and more than one columns.
table headings may have abbreviated form of the headings in the abbr attribute.
Tag omission
End tag (</th>) may be omitted.
Global Attributes
All the global attributes are applicable on the th element.
Global Attributes
All the global attributes are applicable on a element.
Next Previous
Was this article helpful?