Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML DOM TableHeader object


May 06, 2021 JavaScript with HTML DOM Reference book


Table of contents


HTML DOM TableHeader object


TableHeader object

The TableHeader object represents an HTML-lt;th-gt; element.

Access the TableHeader object

You can use getElementById() to access the elements:

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

Tip: You can also access tableHeader objects by searching the cells collection of forms.

Create a TableHeader object

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

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

TableHeader object properties

Attributes describe
abbr Set or return the value of the Abbr property.
align It is not supported in HTML5.use style.textAlign Replace.
Set or return the horizontal alignment of the content in the data cell.
axis It is not supported in HTML5.
Set or return a list of related data cells separated by commas.
background It is not supported in HTML5.use style.background Replace.
Set or return to the background image of the data cell.
bgColor It is not supported in HTML5.use style.backgroundColor Replace.
Set or return to the background color of the table.
cellIndex Returns the location of the cell collections in the form line.
ch It is not supported in HTML5.
Set or return the alignment character according to the data cell.
chOff It is not supported in HTML5.
Set or return the horizontal offset of the CH attribute.
colSpan Set or return the value of the colSpan property.
headers Set or return the value of the Headers property.
height It is not supported in HTML5.use style.height Replace.
Set or return the height of the data cell.
noWrap It is not supported in HTML5.use style.whiteSpace Replace.
Set or return to the content in the cell.
rowSpan Set or returns the value of the ROWSPAN property.
vAlign It is not supported in HTML5.use style.verticalAlign Replace.
Set or return the vertical alignment of the content in the cell.
width It is not supported in HTML5.use style.width Replace.
Set or return the width of the data cell.

Standard properties and events

TableHeader objects also support standard properties and events.


Related articles

HTML tutorial: HTML tables

HTML Reference Manual: HTML slt;th> Tags