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

HTML DOM td / th Object

HTML DOM td/th Object


The td object

The td object represents a data cell in HTML.

In an HTML table, each tag creates a td object.


The th object

The th object represents a header cell in the HTML standard.

In HTML, each tag creates a th object.


td/th Object Properties

W3C: W3C standard.

property Description W3C
abbr Sets or returns an abbreviated version of the content in the cell. Yes
align Deprecated. Sets or returns the horizontal alignment of the data inside the cell. D
axis Sets or returns a comma-separated list of related cells. Yes
background Deprecated. Sets or returns the background image of the table. D
bgColor Deprecated. Sets or returns the background color of the table D
cellIndex Returns the position of the cell in the cell collection of a row. Yes
ch Sets or returns the alignment character of the cell. Yes
chOff Sets or returns the offset of the alignment character of the cell. Yes
colSpan The number of columns the cell spans. Yes
headers Sets or returns the id value of the header-cell. Yes
height Deprecated. Sets or returns the height of the data cell D
noWrap Deprecated. The nowrap attribute specifies that the content in a table cell does not wrap. D
rowSpan Sets or returns the number of rows a cell can span. Yes
vAlign Sets or returns the vertical alignment of the data inside the table cell. Yes
width Deprecated. Sets or returns the width of the cell. D

Standard properties and events

The td/th object also supports standard property and Events.