Vlastnost tBodies

Vlastnost tBodies uchovává pole všech tbody tabulky (může jich být několik).

Syntaxe

javascripttabulka.tBodies;

Příklad

Získáme a projdeme cyklem všechny tbody tabulky:

html<table id="table">
  <thead>
    <tr>
      <th>header1</th>
      <th>header2</th>
      <th>header3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>value</td>
      <td>value</td>
      <td>value</td>
    </tr>
    <tr>
      <td>value</td>
      <td>value</td>
      <td>value</td>
    </tr>
  </tbody>
  <tbody>
    <tr>
      <td>value</td>
      <td>value</td>
      <td>value</td>
    </tr>
    <tr>
      <td>value</td>
      <td>value</td>
      <td>value</td>
    </tr>
  </tbody>
</table>
javascriptlet table = document.querySelector('#table');

for (let tBody of table.tBodies) {
  console.log(tBody);
}

Viz také

  • vlastnost tHead,
    která obsahuje thead tabulky
  • vlastnost tFoot,
    která obsahuje tfoot tabulky
  • vlastnost rows,
    která obsahuje řádky tabulky
  • vlastnost cells,
    která obsahuje buňky tabulky