Table tbody collection
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
| 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





All major browsers support the tBodies collection
Example
Example
Display the number of tbodies in the table:
| cell 1 | cell 2 |
| cell 3 | cell 4 |
Try it »
More examples
Pop up the content of the first 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
Table object