Repesents the header in a table element. | HTML 4, 4.01, 5 |
HTML Syntax
<table>
<thead>
...
</thead>
...
</table>
The <tbody
> element encapsulates a table row that comprises the header of a parent <table> element.
Its content typically represent column names or headings.
The <tbody
> is exposed for all tables, even if the table did not explicitly define a thead element.
NOTE: This element can only be used within a <table
> element.
A <thead
> element’s end tag can be omitted if the <thead
> element is immediately followed by a <tbody
> or <tfoot
> element.
The <thead>
element has no attribute of its own, but supports global attributes common to all HTML elements.
This example shows the relationship between the thead, tbody and tfoot elements, and how using CSS can illustrate their roles in the table model.
Sample Code
Invoice |
Product Name |
Quantity |
Unit Price |
Discount |
Net Amount |
10643 |
Rössle Sauerkraut |
15 |
$45.60 |
0.25 |
$513.00 |
10643 |
Chartreuse verte |
21 |
$18.00 |
0.25 |
$283.50 |
10643 |
Spegesild |
2 |
$12.00 |
0.25 |
$18.00 |
Totals |
$814.50 |
Invoice | Product Name | Quantity | Unit Price | Discount | Net Amount |
10643 | Rössle Sauerkraut | 15 | $45.60 | 0.25 | $513.00 |
10643 | Chartreuse verte | 21 | $18.00 | 0.25 | $283.50 |
10643 | Spegesild | 2 | $12.00 | 0.25 | $18.00 |
Totals |
$814.50 |
TABLE TBODY TD TFOOT TH TR Using Tables