what is TH tag ? Also, state its attributes
Answers
Answer:
The HTML <th> tag defines a header cell that can appear in the first row of an HTML table. Browsers traditionally render the text found within the <th> tag as bold, center-aligned text. This tag is also commonly referred to as the <th> element.
Syntax
In HTML, the syntax for the <th> tag is: (example of a table where the first row contains the header cells)
<body>
<table>
<tr>
<th>Item</th>
<th>Amount</th>
</tr>
<tr>
<td>Apples</td>
<td>$15</td>
</tr>
</table>
</body>
------------------------------------------------------------------------
Or, the <th> tag can be defined within the optional <thead>
<body>
<table>
<thead>
<tr>
<th>Item</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>Apples</td>
<td>$15</td>
</tr>
</tbody>
</table>
</body>