HTML <tbody>Tag
Examples
An HTML table with <thead>, <tfoot>, and <tbody> elements:
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tfoot>
<tr>
<td>Sum</td>
<td>$180</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
</table>
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the <tbody> tag.
Tag Definition and Usage Instructions
The <tbody> tag is used to group the body content of an HTML table.
The <tbody> element should be combined with<thead> and <tfoot>the elements to specify the various parts of the table (body, header, footer).
Through the use of these elements, browsers can support scrolling of the table body independently of the table header and footer. When a long table that spans multiple pages is printed, the table header and footer can be printed on each page that contains table data.
The <tbody> tag must be used in the following context: as a child of a <table> element, appearing after the <caption>, <colgroup>, and <thead> elements.
Tips and Notes
Note:The <tbody> element must contain one or more <tr> tags.
Tip:The <thead>, <tbody>, and <tfoot> elements do not affect the table layout by default. However, you can use CSS to style these elements, thereby changing the appearance of the table.
Differences Between HTML 4.01 and HTML5
In HTML5, the attributes of the <tbody> tag in HTML 4.01 are no longer supported.
Attributes
| Attribute | Value | Description |
|---|---|---|
| align | right left center justify char |
Not supported in HTML5.Defines the alignment of content in the <tbody> element. |
| char | character | Not supported in HTML5.Specifies which character to use for text alignment of the content in the <tbody> element. |
| charoff | number | Not supported in HTML5.Specifies the offset of the first alignment character of the content in the <tbody> element. |
| valign | top middle bottom baseline |
Not supported in HTML5.Specifies the vertical alignment of the content in the <tbody> element. |
Global Attributes
The <tbody> tag supportsHTML Global Attributes。
Event Attributes
The <tbody> tag supportsHTML Event Attributes。
Other Extensions