The TD and TH Elements


The <TD> and <TH> Elements

The actual data in tables is contained in <TD> and <TH> elements. You can find the properties of the <TD> and <TH> elements in Table 14.14. Remember that JavaScript's core HTML properties, methods , and events, which we covered in Chapters 5 and 6, apply to the <TD> and <TH> elements as well.

Table 14.14. The Properties of the <TH> and <TD> Elements (See Chapters 5 and 6 for the JavaScript core HTML properties, methods, and events that also apply to these elements.)

Property

NS2

NS3

NS4

NS6

IE3a

IE3b

IE4

IE5

IE5.5

IE6

abbr

     

x

         

x

 

Read/write

 

Sets or gets the abbreviated text for the element. Set to a string.

align

x

x

x

x

x

x

x

x

x

x

 

Sets or gets the alignment of the cell . Set to "center" (aligns to the center), "justify" (aligns to the left and right edge), "left" (the defaultaligns to the left edge), or "right" (aligns to the right edge).

axis

     

x

         

x

 

Read/write

 

Sets or gets a comma-delimited list of categories associated with the cell, as text. This information can be used for nonvisual media or Braille.

background

           

x

x

x

x

 

Read/write

 

Sets or gets the background picture behind the cell. Set to the URL of an image.

bgColor

     

x

   

x

x

x

x

 

Read/write

 

Sets or gets the background color for the cell. Set to a color triplet (such as "ffffff" ) or a predefined color the browser understands (such as "green" ).

borderColor

           

x

x

x

x

 

Read/write

 

Sets or gets the border color. Set to a color triplet (such as "ffffff" ) or a predefined color the browser understands (such as "lightgreen" ).

borderColorDark

           

x

x

x

x

 

Read/write

 

Holds a color used for shading effects to make the table look "raised." Set to a color triplet (such as "ffffff" ) or a predefined color the browser understands (such as "purple" ).

borderColorLight

           

x

x

x

x

 

Read/write

 

Holds a color used for shading effects to make the table look "raised." Set to a color triplet (such as "ffffff" ) or a predefined color the browser understands (such as "rose" ).

cellIndex

     

x

   

x

x

x

x

 

Read-only

 

The index of this cell in the cells collection. Set to an integer.

ch

     

x

         

x

 

Read/write

 

Corresponds to the CHAR attribute in the cell, but doesn't actually do anything in either browser yet.

chOff

     

x

         

x

 

Read/write

 

Corresponds to the CHAROFF attribute in the cell , but doesn't actually do anything in either browser yet.

colSpan

     

x

   

x

x

x

x

 

Read/write

 

Corresponds to the COLSPAN attribute, and indicates how many columns the cell spans . Set to an integer.

headers

     

x

         

x

 

Read/write

 

Sets or gets a list of header cells that provide information for the object. This information can be used for nonvisual media or Braille.

height

     

x

   

x

x

x

x

 

Read/write

 

Holds the height of the cell, in pixels. Set to an integer.

noWrap

     

x

   

x

x

x

x

 

Read/write

 

Indicates whether the text in a cell wraps automatically. Set to true (text wraps) or false (the defaulttext does not wrap).

rowSpan

     

x

   

x

x

x

x

 

Read/write

 

Corresponds to the ROWSPAN attribute, and indicates how many rows the cell spans. Set to an integer.

vAlign

     

x

   

x

x

x

x

 

Read/write

 

Sets or gets how cell contents are aligned. Set to "middle" (the defaultaligns the text in the middle), "baseline" (aligns the base line of the first line of text with the base lines in adjacent objects), "bottom" (aligns the text at the bottom of the row), or "top" (aligns the text at the top of the row).

width

     

x

   

x

x

x

x

 

Read/write

 

The width of the cell, in pixels. Set to an integer.



Inside Javascript
Inside JavaScript
ISBN: 0735712859
EAN: 2147483647
Year: 2005
Pages: 492
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net