HTML table headers are used to specify the header cells in an HTML table. The <th> tag is used to define a table header cell.
Here’s an example of an HTML table with headers:
<table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
In this example, the <th> tag is used to define the header cells “Month” and “Savings” in the first row of the table. The <td> tag is used to define the data cells “January”, “$100”, “February”, and “$80” in the subsequent rows.
By default, the text in <th> cells is bold and centered. However, you can use CSS to customize the appearance of the headers to match your design needs.
