The <tbody> element groups the main data rows of a <table>. Those rows are <tr> elements with <td> or <th> cells.
Pair it with <thead> for column headers and <tfoot> for totals or notes. Explicit groups help CSS, printing, and assistive technologies. You may use more than one consecutive <tbody> to split large tables into sections.
Baseline · Widely available.
Not deprecated. Core tbody support has been stable across browsers since about July 2015 (and much earlier in practice).
Deprecated attributes.
Do not use align, bgcolor, char, charoff, or valign on <tbody>. Prefer CSS text-align, background-color, and vertical-align.
Implicit tbody.
If you put <tr> directly under <table>, the browser wraps them in a <tbody>. That is why table > tr often matches nothing.
Syntax
HTML Syntax
syntax.html
<tbody>tr rows</tbody>
Place <tbody> inside <table>, after any <caption>, <colgroup>, and <thead>. Content is zero or more <tr> rows. Start/end tags may be omitted in some cases, but writing them is clearer for learners.
Reference
Attributes
Modern <tbody> has no current element-specific attributes — only global attributes. These older attributes are deprecated (shown for migration):
Style body rows with selectors like tbody tr:nth-child(even). Remember an implicit tbody exists even when you omit the tags.
Frequently Asked Questions
The tbody element groups the main data rows of a table. It sits with thead (column headers) and tfoot (summary rows) to mark clear table sections.
Not always in markup. If you put tr elements directly under table, the browser inserts a tbody for you. Writing tbody yourself makes structure and CSS clearer.
Yes. Consecutive tbody elements can split a large table into sections (for example by category). A table may have only one thead and one tfoot.
Inside table, after any caption, colgroup, and thead. Put tfoot after thead as well; browsers still show the footer at the bottom.
Because bare rows under table are wrapped in an implicit tbody. Prefer selectors like tbody tr or table tr instead of table > tr.
No. Those attributes are deprecated. Style the body with CSS such as background-color, text-align, and vertical-align.