Firefox Tomorrow

web api instance method

HTMLTableElement: createTBody() method

View on MDN ↗

The createTBody() method of HTMLTableElement objects creates and returns a new <tbody> element associated with a given <table>.

[!NOTE] Unlike createTHead() and createTFoot(), createTBody() systematically creates a new <tbody> 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

None.

Return value

HTMLTableSectionElement

Examples

let myBody = myTable.createTBody();
// Now this should be true: myBody === myTable.tBodies.item(myTable.tBodies.length - 1)

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.