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

HTML DOM Table tbody collection

Table tbody collection

Table Object Reference Table object


Definition and Usage

The tBodies collection returns a collection of elements in the table.

Note: The elements in the collection are sorted by the position they appear in the source code.

Syntax

tableObject.tBodies

Properties

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

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

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the tBodies collection


Example

Example

Display the number of tbodies in the table:

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