HTMLTableElement : HTMLElement
Return to: HTML DOM Level 2 index

A table in an HTML document.

Platform Support

IE Mozilla Netscape Opera Safari Chrome
4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no

Constructors

Constructor Action IE Mozilla Netscape Opera Safari Chrome
HTMLTableElement Constructor() : HTMLTableElement
A table in an HTML document.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no

HTMLTableElement() : HTMLTableElement

A table in an HTML document.

Returns
HTMLTableElement

Visibility
internal

Properties

Property Action IE Mozilla Netscape Opera Safari Chrome
caption : HTMLTableCaptionElement
Reference to the table Caption element.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no

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

rows : HTMLCollection
Array of all of the HTMLTableRowElement objects in the table.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no

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

tBodies : HTMLCollection
Array of all of the HTMLTableSectionElement objects in the table.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
  • IE: Writing to "innerHTML" does not work in IE.

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

tFoot : HTMLTableSectionElement
The tfoot element for the table.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
  • IE: Writing to "innerHTML" does not work in IE.

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

tHead : HTMLTableSectionElement
The thead element for the table.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
  • IE: Writing to "innerHTML" does not work in IE.

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

Functions

Method Action IE Mozilla Netscape Opera Safari Chrome
createCaption() : HTMLElement
Creates a caption element for the table or returns the existing caption.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
  • IE: On Mac, works on existing Caption only.

Returns
HTMLElement

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() : HTMLElement
Creates a tfoot element for the table or returns the existing tfoot.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
  • IE: On Mac, works on existing TFoot only.

Returns
HTMLElement

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() : HTMLElement
Creates a thead element for the table or returns the existing thead.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
  • IE: On Mac, works on existing THead only.

Returns
HTMLElement

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.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no

Returns
void

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.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no

Parameters
Number index Index of the row to delete.

Returns
void

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.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no

Returns
void

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.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no

Returns
void

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) : HTMLElement
Inserts a new empty row (tr element) at the specified position in the table.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no

Parameters
Number index Index for the row before where the new row will be inserted.

Returns
HTMLElement

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

References

HTMLTableCaptionElement|HTMLTableCellElement|HTMLTableColElement|HTMLTableRowElement|HTMLTableSectionElement

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

text_javascript aptana_docs