Latest web development tutorials

HTML DOM td / th objects

td objects

td object represents the HTML data units.

Each <td> td tag creates an object in the HTML table.


th objects

th object represents the HTML standard meter unit.

Each HTML <th> tag creates a th object.


td / th object properties

W3C: W3C standards.

属性 描述 W3C
abbr 设置或返回单元格中内容的缩写版本。 Yes
align 已废弃。 设置或返回单元格内部数据的水平排列方式。 D
axis 设置或返回相关单元格的一个逗号分隔的列表。 Yes
background 已废弃。 设置或返回表格的背景图片。 D
bgColor 已废弃。 设置或返回表格的背景颜色 D
cellIndex 返回单元格在某行的单元格集合中的位置。 Yes
ch 设置或返回单元格的对齐字符。 Yes
chOff 设置或返回单元格的对齐字符的偏移量。 Yes
colSpan 单元格横跨的列数。 Yes
headers 置或返回 header-cell 的 id 值。 Yes
height 已废弃。 设置或返回数据单元的高度 D
noWrap 已废弃。 nowrap 属性规定表格单元格中的内容不换行。 D
rowSpan 设置或返回单元格可横跨的行数。 Yes
vAlign 设置或返回表格单元格内数据的垂直排列方式。 Yes
width 已废弃。设置或返回单元格的宽度。 D

Standard properties and events

td / th objects also supports the standard attributes and events .