HTML DOM TableObject


Table Object

The Table object represents an HTML table.

Each time a <table> tag appears 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 DeprecatedSets or returns the background of the table. D
bgColor DeprecatedThe background color of the table. D
border DeprecatedSets or returns the width of the table border. instead D
caption Returns the table caption. Yes
cellPadding Sets or returns the amount of space between the cell content and the cell border. Yes
cellSpacing Sets or returns the amount of space between cells in the table. Yes
frame Sets or returns the external border of the table. Yes
height DeprecatedSets or returns the height of the table. instead D
rules Sets or returns the internal border (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 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 DeprecatedSets 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() Removes the caption element and its contents from the table. Yes
deleteRow() Removes a row from the table. Yes
deleteTFoot() Removes the tFoot element and its contents from the table. Yes
deleteTHead() Removes the tHead element and its contents from the table. Yes
insertRow() Inserts a new row in the table. Yes

Standard Properties and Events

The Table object also supports standardPropertiesandEvents。

Other Extensions