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

HTML DOM TableHeader Object

HTML DOM TableHeader Object


The TableHeader object

The TableHeader object represents an HTML element.

Access the TableHeader Object

You can use getElementById() to access the element:

var x = document.getElementById("myTh");

Try it

**Tip:** You can also access the Fieldset object by searching a form's cells Access the TableHeader object using the collection.

Create the TableHeader Object

You can use the document.createElement() method to create the element:

var x = document.createElement("TH");

Try it

TableHeader Object Properties

property Description
abbr Sets or returns the value of the abbr attribute.
align Not supported in HTML5. Use style.textAlign as a replacement.
Sets or returns the horizontal alignment of the content in the data cell.
axis Not supported in HTML5.
Sets or returns a comma-separated list of related data cells.
background Not supported in HTML5. Use style.background as a replacement.
Sets or returns the background image of the data cell.
bgColor Not supported in HTML5. Use style.backgroundColor as a replacement.
Sets or returns the background color of the table.
ch Not supported in HTML5.
Sets or returns the alignment character of the data cell.
chOff Not supported in HTML5.
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 as a replacement.
Sets or returns the height of the data cell.
noWrap Not supported in HTML5. Use style.whiteSpace as a replacement.
Sets or returns whether the content in the cell wraps.
rowSpan Sets or returns the value of the rowspan attribute.
vAlign Not supported in HTML5. Use style.verticalAlign as a replacement.
Sets or returns the vertical alignment of the content in the cell.
width Not supported in HTML5. Use style.width as a replacement.
Sets or returns the width of the data cell.

Standard properties and events

The TableHeader object also supports standard property and Events.


Related Articles

HTML Tutorial:HTML Tables

HTML Reference Manual:HTML Tag