tBodies property
The tBodies property stores an
array of all
tbody's
of a tables (there may be more than one).
Syntax
table.tBodies;
Example
Get and loop through all
tbody's of a table:
<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>
let table = document.querySelector('#table');
for (let tBody of table.tBodies) {
console.log(tBody);
}