Easy Tutorial
❮ Jsref Tan Prop Audio Preload ❯

HTML DOM TableHeader Object


TableHeader Object

The TableHeader object represents an HTML <th> element.

Accessing TableHeader Object

You can use getElementById() to access a <th> element:

Tip: You can also access the TableHeader object by searching the cells collection of the table.

Creating TableHeader Object

You can use the document.createElement() method to create a <th> element:

TableHeader Object Properties

Property Description
abbr Sets or returns the value of the abbr attribute.
align Not supported in HTML5. Use style.textAlign instead. <br>Sets or returns the horizontal alignment of content in a data cell.
axis Not supported in HTML5. Sets or returns a comma-separated list of related data cells.
background Not supported in HTML5. Use <br>style.background instead. <br>Sets or returns the background image of a data cell. <br>
bgColor Not supported in HTML5. Use <br>style.backgroundColor instead. <br>Sets or returns the background color of the table. <br>
ch Not supported in HTML5. <br>Sets or returns the alignment character for data cells.
chOff Not supported in HTML5. <br>Sets or returns the horizontal offset of the ch attribute.
colSpan Sets or returns the value of the colspan attribute.
headers Sets or returns the value of the headers attribute.
height Not supported in HTML5. Use style.height instead. <br>Sets or returns the height of a data cell.
noWrap Not supported in HTML5. Use <br>style.whiteSpace instead. <br>Sets or returns whether the content in a cell wraps.
rowSpan Sets or returns the value of the rowspan attribute.
vAlign Not supported in HTML5. Use style.verticalAlign <br>instead. <br>Sets or returns the vertical alignment of content in a cell.
width Not supported in HTML5. Use style.width instead. <br>Sets or returns the width of a data cell.

Standard Properties and Events

The TableHeader object also supports standard properties and events.


Related Articles

HTML Tutorial: HTML Tables

HTML Reference: HTML <th> Tag

❮ Jsref Tan Prop Audio Preload ❯