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()
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
