HTMLTableElement: createTFoot() method
HTML DOM
HTML DOM
The createTFoot() method of the HTMLTableElement interface creates a tfoot element, inserts it as the last child of the given table, and returns it. If the table already has a <tfoot> element child, this method returns the first such child without creating one.
When creation is needed, this method creates and inserts the element directly, without requiring separate calls to methods such as Document.createElement() and Node.appendChild().
Syntax
createTFoot()
Parameters
None.
Return value
An HTMLTableSectionElement (which is always a tfoot).
Examples
const myFoot = myTable.createTFoot();
// Now this should be true: myFoot === myTable.tFoot
Specifications
Browser compatibility
See also
- HTMLTableElement.createCaption()
- HTMLTableElement.createTBody()
- HTMLTableElement.createTHead()
- HTMLTableElement.deleteTFoot()