W3Schools.com

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.



WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$7.95/mo SEO Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Free Website Templates Free CSS Templates
Make Your Own Website
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE