Search w3schools.com:

SHARE THIS PAGE

HTML DOM td/th Object


td Object

The td object represents a data cell in an HTML table.

For each <td> tag in an HTML table, a td object is created.


th Object

The th object represents a table header cell in an HTML table.

For each <th> tag in an HTML table, a th object is created.


td/th Object Properties

Note: The TD/TH object can also use the properties/methods of:

W3C: W3C Standard.

Property Description W3C
abbr Sets or returns an abbreviated version of the content in a data cell Yes
align Deprecated. Sets or returns the horizontal alignment of the content in a data cell. Use style.textAlign instead D
axis Sets or returns a comma-separated list of related data cells Yes
background Deprecated. Sets or returns the background image of a data cell. Use style.background instead D
bgColor Deprecated. Sets or returns the background color of a table. Use style.backgroundColor instead D
cellIndex Returns the position of a cell in the cells collection of a table row Yes
ch Sets or returns an alignment character for a data cell Yes
chOff Sets or returns the horizontal offset of the ch property Yes
colSpan Sets or returns the number of columns a cell should span Yes
headers Sets or returns a list of header cell ids for the current data cell Yes
height Deprecated. Sets or returns the height of a data cell. Use style.height instead D
noWrap Deprecated. Sets or returns whether the content in a cell can be wrapped. Use style.whiteSpace instead D
rowSpan Sets or returns the number of rows a cell should span Yes
vAlign Sets or returns the vertical alignment of the content within a cell Yes
width Deprecated. Sets or returns the width of a data cell. Use style.width instead D

Standard Properties and Events

The TD/TH object also supports the standard properties and events.



Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]