All <table> elements can be divided into three parts: <thead>, <tbody>, and <tfoot>. <thead> contains the rows in the table header. <tbody> contains the rows in the table body. <tfoot> contains the rows in the table footer.
thead>, <tbody>, and <tfoot> elements with the <table> element inform the browser the breakdown of the sections and allows you to apply different styles to the heading, body, and footer.
<thread> |
Yes | Yes | Yes | Yes | Yes |
HTML 4.01 attributes are deprecated in HTML5.
Attribute | Value | Description |
---|---|---|
align | right left center justify char |
Not supported in HTML5. Align the thead content |
char | character | Not supported in HTML5. Align the thead content to a character |
charoff | number | Not supported in HTML5. Sets the number of characters to align the thead content from the character in the char attribute |
valign | top middle bottom baseline |
Not supported in HTML5. Vertical aligns the thead content |
The <thead> tag supports the Global Attributes in HTML.
The <thead> tag supports the Event Attributes in HTML.
thead { display: table-header-group; vertical-align: middle; border-color: inherit; }
<html>
<body>
<table>
<thead>
<td>This cell is in the thead rows group.</td>
<td>This cell is in the thead rows group.</td>
<td>This cell is in the thead rows group.</td>
</thead>
<tbody>
<tr>
<td>This cell is in the tbody rows group.</td>
<td>This cell is in the tbody rows group.</td>
<td>This cell is in the tbody rows group.</td>
</tr>
</tbody>
</table>
</body><!-- w ww.j a v a 2s . c o m-->
</html>