Easy Tutorial
❮ Prop Style Cursor Coll Tr Cells ❯

Table cells Collection


Definition and Usage

The cells collection returns all <td> or <th> elements in a table.

Syntax

Properties

Property Description
length Returns the number of <td> or <th> elements in the collection.

Methods

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 element index with the specified name in the collection

Browser Support

All major browsers support the cells collection.


Example

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


More Examples

Popup content of the first row

Add a row

Align content in cells of a table row

Vertical alignment of content in cells of a table row

Align content in a single cell

Vertical alignment of content in a cell

Change the content of a table cell

Merge cells


❮ Prop Style Cursor Coll Tr Cells ❯