HTMLTableElement: tBodies プロパティ

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.

HTMLTableElement.tBodies は読み取り専用のプロパティで、生きた HTMLCollection<table> の本体を返します。

このプロパティは読み取り専用ですが、返値のオブジェクトは生きており、内部を変更することができます。

返されるコレクションには、暗黙の <tbody> 要素を含みます。例えば、

html
<table>
  <tr>
    <td>セル 1</td>
  </tr>
</table>

上記の HTML から生成される HTML DOM には、 HTML ソースにタグが含まれていなくても、 <tbody> 要素が存在しています。

生きた HTMLCollection です。

このスニペットは、表の中の本体の数を数えます。

js
mytable.tBodies.length;

仕様書

Specification
HTML
# dom-table-tbodies-dev

ブラウザーの互換性

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

関連情報