HTML <thead> Tag
In this tutorial, we will learn about thead tag in HTML with the help of examples.
<thead> Tag
Thead tag <thead> is used to specify a header cell or a table header in an HTML table.
Note : The text in <thead> tag are bold and centered by default.
Syntax
<thead>..........</thead>
Example
<!DOCTYPE html>
<html>
<head>
<title>thead tag</title>
</head>
<body>
<table>
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Age</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sunny</td>
<td>Chaudhary</td>
<td>20</td>
</tr>
<tr>
</tbody>
<tfoot>
<td>Anu</td>
<td>Chaudhary</td>
<td>19</td>
</tr>
</tfoot>
</table>
</body>
</html>
Output
Specific Attribute
Attribute | Value | Description |
---|---|---|
align | right left center justify char |
It is used for visual alignment |
char | character | It is used to specify which character to align text on. It is used when align = char |
charoff | pixels percentage(%) |
It is used to specify an alignment offset(either in pixels or percentage value) against the first character as specified with the char attribute. It is used when align = char |
valign | top middle bottom baseline |
It is used for vertical alignment |
Global Attribute
Thead Tag support all the global attributes of HTML.
Event Attribute
Thead Tag support all the event attributes of HTML.
Next Tutorial
We hope that this tutorial helped you develop better understanding of the concept of <thead> tag in HTML.
Keep Learning : )
In the next tutorial, you'll learn about HTML <time>
Tag.