DOM Interfaces

HTMLTableSectionElement

Represents thead, tbody or tfoot and exposes its live rows collection and row insertion/deletion operations. A table can have multiple tbody sections. The browser may insert a tbody when parsing markup with direct tr children. Example result: 1.

Formal Syntax & Structure

html syntaxhtml
const element = document.getElementById('demo'); // HTMLTableSectionElement

Return Value

HTMLTableSectionElement

An existing HTML DOM object associated with the tbody element in this example; this interface is a type, not a function return contract.

Working Example

Example Snippethtml
<table>  <tbody id="demo">    <tr>      <td>1</td>    </tr>  </tbody></table><p>  Result:  <output id="result"></output></p><script>  const e = document.getElementById('demo');  const result = value => { document.getElementById("result").textContent = String(value); };  result(e.rows.length);</script>
HTML Reference