Latest web development tutorials

HTML DOM tr objects

tr objects

tr object represents an HTML table row.

HTML document appears in a <tr> tag, it will create a tr object.


tr collection of objects

W3C: W3C label.

集合 描述 W3C
cells 返回表格行中所有<td>和<th>元素的集合 Yes

tr object properties

属性 描述 W3C
align 已废弃。 设置或返回在行中数据的水平排列。 D
bgColor 已废弃。 设置或返回表格行的的颜色。 D
ch 设置或返回在行中单元格的对齐字符。 Yes
chOff 设置或返回在行中单元格的对齐字符的偏移量。 Yes
height 已废弃。设置或返回表格行的高度。使用 style.height 取代 D
rowIndex 返回该行在表中的位置。 Yes
sectionRowIndex R返回在 tBody 、tHead 或 tFoot 中,行的位置。 Yes
vAlign 设置或返回在行中的数据的垂直排列方式。 Yes

tr object methods

方法 描述 W3C
deleteCell() 删除行中的指定的单元格。 Yes
insertCell() 在一行中的指定位置插入一个空的元素。 Yes

Standard properties and events

tr objects also supports the standard attributes and events .