The HTMLTableElement.createTFoot() method returns the <tfoot> element associated with a given <table>. If no footer exists in the table, this methods creates it, and then returns it.
Note: If no footer exists, createTFoot() inserts a new footer directly into the table. The footer does not need to be added separately as would be the case if Document.createElement() had been used to create the new <tfoot> element.
Syntax
HTMLTableSectionElement = table.createTFoot();
Return value
Example
let myfoot = mytable.createTFoot(); // Now this should be true: myfoot == mytable.tFoot
Specifications
| Specification | Status | Comment |
|---|---|---|
| HTML Living StandardThe definition of 'HTMLTableElement: createTFoot' in that specification. | Living Standard |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
createTFoot
|
Chrome
Full support Yes |
Edge
Full support 12 |
Firefox
Full support Yes |
IE
Full support Yes |
Opera
Full support Yes |
Safari
Full support Yes |
WebView Android
Full support Yes |
Chrome Android
? |
Firefox Android
Full support Yes |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android
? |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
HTMLTableElement.createTFoot() by Mozilla Contributors is licensed under CC-BY-SA 2.5.