THNN n/a   IE 4   DOM 1

The TH object reflects the TH element. While a TH element may inherit a number of visual properties from containers (e.g., the bgColor of a THEAD element), those inherited property values are not automatically assigned to the TH object. Therefore, just because a header cell may have a yellow background color doesn't mean that its bgColor property is set at all.

 
HTML Equivalent
<TH>
 
Object Model Reference
IE [window.]document.all.elementID
alignNN n/a   IE 4   DOM 1
 Read/Write
 

Defines the horizontal alignment of content within the cell.

 
Example
document.all.myTH.align = "center"
 
Value
Any of the three horizontal alignment constants: center | left | right.
 
Default left
backgroundNN n/a   IE 4   DOM n/a
 Read/Write
 

URL of the background image for the cell. If you set a bgColor to the element as well, the color appears if the image fails to load; otherwise, the image overlays the color.

 
Example
document.all.myTH.background = "images/watermark.jpg"
 
Value
Complete or relative URL to the background image file.
 
Default None.
bgColorNN n/a   IE 4   DOM 1
 Read/Write
 

Background color of the table cell. This color setting is not reflected in the style sheet backgroundColor property. Even if the BGCOLOR attribute or bgColor property is set with a plain-language color name, the returned value is always a hexadecimal triplet.

 
Example
document.all.myTH.bgColor = "yellow"
 
Value
A hexadecimal triplet or plain-language color name.
 
Default Varies with browser and operating system.
borderColorNN n/a   IE 4   DOM n/a
 Read/Write
 

Color of the element's border. Internet Explorer applies the color to all four lines that make up the interior border of a cell. Therefore, colors of adjacent cells do not collide.

 
Example
document.all.myTH.borderColor = "salmon"
 
Value
A hexadecimal triplet or plain-language color name. A setting of empty is interpreted as "#000000" (black).
 
Default Varies with operating system.
borderColorDark, borderColorLightNN n/a   IE 4   DOM n/a
 Read/Write
 

The 3-D effect of table borders in Internet Explorer is created by careful positioning of light and dark lines around the page's background or default color. You can independently control the colors used for the dark and light lines by assigning values to the borderColorDark (left and top edges of the cell) and borderColorLight (right and bottom edges) properties.

Typically, you should assign complementary colors to the pair of properties. There is also no rule that says you must assign a dark color to borderColorDark. The attributes merely control a well-defined set of lines so you can predict which lines of the border change with each attribute.

 
Example
document.all.myTH.borderColorDark = "blue"
document.all.myTH.borderColorLight = "cornflowerblue"
 
Value
A hexadecimal triplet or plain-language color name. A setting of empty is interpreted as "#000000" (black).
 
Default Varies with operating system.
cellIndexNN n/a   IE 4   DOM n/a
 Read-only
 

Returns a zero-based integer representing the position of the current cell among all other TH elements in the same row. The count is based on the source code order of the TH elements within a TR element. This property is not available in the Macintosh version of Internet Explorer 4.

 
Example
var whichCell = document.all.myTH.cellIndex
 
Value
Integer.
 
Default None.
clientHeight, clientWidthNN n/a   IE 4   DOM n/a
 Read/Write
 

According to Microsoft's developer documentation, these properties reflect the height and width (in pixels) of the element's content.

 
Example
var midHeight = document.all.myTH.clientHeight/2
 
Value
Integer pixel value.
 
Default None.
colSpanNN n/a   IE 4   DOM 1
 Read/Write
 

The number of columns across which the current table cell should extend itself. For each additional column included in the colSpan count, one less TH or TD element is required for the table row. If you set the align property to center or right, the alignment is calculated on the full width of the TH element across the specified number of columns. Unless the current cell also specifies a ROWSPAN attribute, the next table row returns to the original column count.

 
Example
document.all.myTH.colSpan = 2
 
Value
Any positive integer, usually 2 or larger.
 
Default 1
height, widthNN n/a   IE 4   DOM n/a
 Read/Write
 

The height and width in pixels of the element. Changes to these values are immediately reflected in reflowed content on the page. These properties are read-only in the Macintosh version of Internet Explorer 4.

 
Example
document.all.myTH.height = 250
 
Value
Integer.
 
Default None.
noWrapNN n/a   IE 4   DOM 1
 Read/Write
 

Whether the browser should render the cell as wide as is necessary to display a line of nonbreaking text on one line. Abuse of this attribute can force the user into a great deal of inconvenient horizontal scrolling of the page to view all of the content.

 
Example
document.all.myTH.noWrap = "true"
 
Value
Boolean value: true | false.
 
Default false
rowSpanNN n/a   IE 4   DOM 1
 Read/Write
 

The number of rows through which the current table cell should extend itself downward. For each additional row included in the rowSpan count, one less TH or TD element is required for the next table row. If you set the vAlign property to middle, the alignment is calculated on the full height of the TH element across the specified number of rows.

 
Example
document.all.myTH.rowSpan = 12
 
Value
Any positive integer, usually 2 or larger.
 
Default 1
vAlignNN n/a   IE 4   DOM 1
 Read/Write
 

The manner of vertical alignment of text within the element's content box.

 
Example
document.all.myTH.vAlign = "baseline"
 
Value
Case-insensitive constant (as a string): baseline | bottom | middle | top.
 
Default middle
blur( )NN n/a   IE 4   DOM n/a

Removes focus from the current element and fires an onBlur event (in IE). No other element necessarily receives focus as a result.

 
Returned Value
None.
 
Parameters
None.
focus( )NN n/a   IE 4   DOM n/a

Gives focus to the current element and fires the onFocus event (in IE). If another element had focus at the time, it receives an onBlur event.

 
Returned Value
None.
 
Parameters
None.