HTMLTableElement : HTMLElement

A table in an HTML document.

Browser/User Agent Support

IEMozillaNetscapeOperaSafariNetscapte
4.0+1.0+6.0+7.0+1.0+no

Constructors

ConstructorIEMozillaNetscapeOperaSafariNetscapte
A table in an HTML document.
4.0+1.0+6.0+7.0+1.0+no
 

Properties

PropertyIEMozillaNetscapeOperaSafariNetscapte
Reference to the table Caption element.
4.0+1.0+6.0+7.0+1.0+no
 
Array of all of the HTMLTableRowElement objects in the table.
4.0+1.0+6.0+7.0+1.0+no
 
Array of all of the HTMLTableSectionElement objects in the table.
4.0+1.0+6.0+7.0+1.0+no
  • IE: Writing to "innerHTML" does not work in IE.
The tfoot element for the table.
4.0+1.0+6.0+7.0+1.0+no
  • IE: Writing to "innerHTML" does not work in IE.
The thead element for the table.
4.0+1.0+6.0+7.0+1.0+no
  • IE: Writing to "innerHTML" does not work in IE.

Methods

MethodIEMozillaNetscapeOperaSafariNetscapte
Creates a caption element for the table or returns the existing caption.
4.0+1.0+6.0+7.0+1.0+no
  • IE: On Mac, works on existing Caption only.
Creates a tfoot element for the table or returns the existing tfoot.
4.0+1.0+6.0+7.0+1.0+no
  • IE: On Mac, works on existing TFoot only.
Creates a thead element for the table or returns the existing thead.
4.0+1.0+6.0+7.0+1.0+no
  • IE: On Mac, works on existing THead only.
Deletes the caption element from the table.
4.0+1.0+6.0+7.0+1.0+no
 
Deletes a row at the specified position in the table.
4.0+1.0+6.0+7.0+1.0+no
 
Deletes the tfoot element from the table.
4.0+1.0+6.0+7.0+1.0+no
 
Deletes the thead element from the table.
4.0+1.0+6.0+7.0+1.0+no
 
Inserts a new empty row (tr element) at the specified position in the table.
4.0+1.0+6.0+7.0+1.0+no
 

References

HTMLTableCaptionElement | HTMLTableCellElement | HTMLTableColElement | HTMLTableRowElement | HTMLTableSectionElement

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

Constructor Detail

HTMLTableElement HTMLTableElement()

A table in an HTML document.

Visibility
internal

Property Detail

HTMLTableCaptionElement caption

Reference to the table Caption element.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/table_access.html

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

HTMLCollection rows - read only

Array of all of the HTMLTableRowElement objects in the table.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/table_access.html

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

HTMLCollection tBodies - read only

Array of all of the HTMLTableSectionElement objects in the table.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/table_access.html

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

HTMLTableSectionElement tFoot

The tfoot element for the table.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/table_access.html

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

HTMLTableSectionElement tHead

The thead element for the table.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/table_access.html

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

Method Detail

createCaption() : static HTMLElement

Creates a caption element for the table or returns the existing caption.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/table_credel.html

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

createTFoot() : static HTMLElement

Creates a tfoot element for the table or returns the existing tfoot.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/table_credel.html

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

createTHead() : static HTMLElement

Creates a thead element for the table or returns the existing thead.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/table_credel.html

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

deleteCaption() : void

Deletes the caption element from the table.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/table_credel.html

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

deleteRow(Number index) : void

Deletes a row at the specified position in the table.

NumberindexIndex of the row to delete.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/table_credel.html

See Also

HTMLTableSectionElement.deleteRow

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

deleteTFoot() : void

Deletes the tfoot element from the table.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/table_credel.html

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

deleteTHead() : void

Deletes the thead element from the table.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/table_credel.html

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

insertRow(Number index) : static HTMLElement

Inserts a new empty row (tr element) at the specified position in the table.

NumberindexIndex for the row before where the new row will be inserted.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/table_credel.html

See Also

HTMLTableSectionElement.insertRow

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C