Tables

HTML <tbody> element

Groups the principal data rows of a table. HTML parsing can insert a tbody when rows are written directly in a table. Explicit tbody groups improve readability and make row-group associations intentional. A browser may insert tbody while parsing source, so DOM selectors must account for the resulting tree. It accepts global HTML attributes; individual global features may be inapplicable or restricted.

Formal Syntax & Structure

html syntaxhtml
<tbody>  <tr>    <td>Data</td>  </tr></tbody>

Return Value

HTMLTableSectionElement

Content model: tr and script-supporting elements.

Working Example

Example Snippethtml
<!doctype html><html lang="en">  <head>    <meta charset="utf-8">    <title>HTML example</title>  </head>  <body>    <table>      <thead>        <tr>          <th scope="col">Item</th>        </tr>      </thead>      <tbody>        <tr>          <td>Book</td>        </tr>      </tbody>    </table>  </body></html>
HTML Reference