HTMLTableElement: createTBody() method
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.
The Note:
Unlike None.createTBody()
method of
HTMLTableElement
objects creates and returns a new
element associated with a given
.
HTMLTableElement.createTHead()
and
HTMLTableElement.createTFoot()
, createTBody()
systematically creates a new element, even if the table
already contains one or more bodies. If so, the new one is inserted after the existing
ones.
Syntax
createTBody()
Parameters
Return value
Examples
let myBody = myTable.createTBody();
// Now this should be true: myBody === myTable.tBodies.item(myTable.tBodies.length - 1)
Specifications
Specification HTML
# dom-table-createtbody-devBrowser compatibility