Easy Tutorial
❮ Jsref Encodeuricomponent Met Cssstyle Getpropertypriority ❯

HTML DOM Table Object


Table Object

The Table object represents an HTML table.

For every <table> tag in an HTML document, a Table object is created.


Table Object Collections

W3C: W3C Standard.

Collection Description 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 elements in the table. Yes

Table Object Properties

Property Description W3C
align Deprecated. The horizontal alignment of the table in the document. D
background Deprecated. Sets or returns the background of the table. D
bgColor Deprecated. The background color of the table. D
border Deprecated. Sets or returns the width of the table border. D
caption Returns the caption of the table. Yes
cellPadding Sets or returns the amount of space between cell content and cell borders. Yes
cellSpacing Sets or returns the amount of space between cells in a table. Yes
frame Sets or returns the outer borders of the table. Yes
height Deprecated. Sets or returns the height of the table. D
rules Sets or returns the inner borders (row lines) of the table. Yes
summary Sets or returns the description (summary) of the table. Yes
tFoot Returns the TFoot object of the table. If the element does not exist, it returns null. Yes
tHead Returns the THead object of the table. If the element does not exist, it returns null. Yes
width Deprecated. Sets or returns the width of the table. D

Table Object Methods

Method Description W3C
createCaption() Creates a caption element for the table. Yes
createTFoot() Creates an empty tFoot element in the table. Yes
createTHead() Creates an empty tHead element in the table. Yes
deleteCaption() Deletes the caption element and its content from the table. Yes
deleteRow() Deletes a row from the table. Yes
deleteTFoot() Deletes the tFoot element and its content from the table. Yes
deleteTHead() Deletes the tHead element and its content from the table. Yes
insertRow() Inserts a new row in the table. Yes

Standard Attributes and Events

The Table object also supports standard attributes and events.

❮ Jsref Encodeuricomponent Met Cssstyle Getpropertypriority ❯