HTMLTableElement: tBodies property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

The HTMLTableElement.tBodies read-only property returns a live HTMLCollection of the bodies in a <table>.

Although the property is read-only, the returned object is live and allows the modification of its content.

The collection returned includes implicit <tbody> elements. For example:

html
<table>
  <tr>
    <td>cell one</td>
  </tr>
</table>

The HTML DOM generated from the above HTML will have a <tbody> element even though the tags are not included in the source HTML.

Value

Examples

This snippet gets the number of bodies in a table.

js
myTable.tBodies.length;

Specifications

Specification
HTML
# dom-table-tbodies-dev

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
tBodies

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

See also