Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Table cells collection

Table cells collection

Table Object Reference Table object


Definition and Usage

The cells collection returns all or elements in the table.

Syntax

tableObject.cells

property

property Description
length Returns the number of in the collection or Number of elements.

Method

Method Description
[name_or_index] An integer specifying the element retrieval position (starting from 0)
item(name_or_index) Returns the element at the specified index in the collection
namedItem(name) Returns the index of the element specified by name index in the collection

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the cells collection


Example

Example

The following example uses cells to display the content of the first cell:

Runoob Tutorial(runoob.com)

    

        

        

    

    

        

        

    

cell 1 cell 2
cell 3 cell 4

Try it »


More examples

Pop up the content of the first row

Add row

Align the cell content in table rows

Vertical alignment of cell content in table rows

Align the content of an individual cell

Vertical alignment of cell content

Change the content of table cells

Merging Cells


Table Object Reference Table object