HTML DOM trObject


tr Object

The tr object represents a row in an HTML table.

A tr object is created whenever a <tr> tag appears in an HTML document.


tr Object Collection

W3C:W3C tag.

Collection Description W3C
cells Returns a collection of all <td> and <th> elements in a table row. Yes

tr Object Properties

Property Description W3C
align Deprecated.Sets or returns the horizontal alignment of data within a row. D
bgColor Deprecated.Sets or returns the background color of the table row. D
ch Sets or returns the alignment character for cells within a row. Yes
chOff Sets or returns the offset of the alignment character for cells within a row. Yes
height Deprecated.Sets or returns the height of a table row. Usestyle.heightinstead D
rowIndex Returns the position of the row within the table. Yes
sectionRowIndex Returns the position of the row within tBody, tHead, or tFoot. Yes
vAlign Sets or returns the vertical alignment of data within a row. Yes

tr Object Methods

Method Description W3C
deleteCell() Deletes the specified cell from the row. Yes
insertCell() Inserts an empty element at the specified position in a row. Yes

Standard Properties and Events

The tr object also supports the standardpropertiesandevents。

Other Extensions