HTML DOM Table object
Table object
The Table object represents an HTML table.
Every time a label appears in an HTML document, a Table object is created.
Table object collection
W3C: W3C standard.
gather | describe | W3C |
---|---|---|
cells | Returns an array containing all cells in the table. | No |
rows | Returns an array containing all rows in the table. | Yes |
tBodies | Returns an array containing all TBODY in the table. | Yes |
Table object properties
Attributes | describe | W3C |
---|---|---|
align | It has been discarded. The table is aligned in the document. | D |
background | Abandoned Set or return to the table background | D |
bgColor | Abandoned Table background color. | D |
border | Abandoned Set or return the width of the table border. instead | D |
caption | Returns the table title. | Yes |
cellPadding | Set or return a blank amount between cell content and cell bits. | Yes |
cellSpacing | Set or return a blank between the cells in the table. | Yes |
frame | Set or return the external border of the table. | Yes |
height | Abandoned Set or return to the table height instead | D |
rules | Set or return the internal border (row line) of the table. | Yes |
summary | Set or return a description of the table (overview). | Yes |
tFoot | Returns the TFOOT object of the table.If this element does not exist, it is null. | Yes |
tHead | Returns the THEAD object of the table.If this element does not exist, it is null. | Yes |
width | Abandoned Set or return to the width of the table. | D |
Table object method
method | describe | W3C |
---|---|---|
createCaption() | Create a CAPTION element for the table. | Yes |
createTFoot() | Create an empty TFOOT element in the table. | Yes |
createTHead() | Create an empty THEAD element in the table. | Yes |
deleteCaption() | Delete the CAPTION element from the table and its content. | Yes |
deleteRow() | Delete a line from the table. | Yes |
deleteTFoot() | Delete TFOOT elements from the table and its content. | Yes |
deleteTHead() | Delete the thead element from the table and its content. | Yes |
insertRow() | Insert a new row in the table. | Yes |
Standard properties and events
Table objects also support standard properties and events.