HTMLTableElement: tBodies-Eigenschaft

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.

Die HTMLTableElement.tBodies-Eigenschaft gibt eine Live-HTMLCollection der tbody-Elemente in einem <table> zurück.

Obwohl die Eigenschaft schreibgeschützt ist, ist das zurückgegebene Objekt live und erlaubt die Modifikation seines Inhalts.

Die zurückgegebene Sammlung umfasst implizite <tbody>-Elemente. Zum Beispiel:

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

Das vom obigen HTML generierte HTML DOM wird ein <tbody>-Element haben, obwohl die Tags im Quell-HTML nicht enthalten sind.

Wert

Eine Live-HTMLCollection.

Beispiele

Dieser Code-Ausschnitt ermittelt die Anzahl der tbody-Elemente in einer Tabelle.

js
myTable.tBodies.length;

Spezifikationen

Specification
HTML
# dom-table-tbodies-dev

Browser-Kompatibilität

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

Siehe auch