Read HTML The Definitive Guide Online
Authors: Chuck Musciano Bill Kennedy
middle, although acceptable, has no real effect since it simply reiterates the default vertical alignment:
Alignment | Top | Baseline | Center | Bottom |
---|---|---|---|---|
Baseline__ Another line | AAyy | _AAyy_ | AAyy | AAyy |
Figure 11.4: Effects of the valign attribute on table cell content alignment
You also may respecify the horizontal and vertical alignments for individual cells within a row (section
Section 11.2.4.1, "The align and valign attributes"). Use the alignment attributes in the
Table 11.1 contains the horizontal (
align) and vertical (valign) table cell-content attribute values and options. Values in parentheses are the defaults for the popular browsers.
Table 11.1: Horizontal and Vertical Table Cell-Content Attribute Values and Options
Attribute Netscape and Internet Explorer
Headers
Data
Left
(Left)
align
(Center)
Center
Right
Right
Justifya
Chara
Chara
Top
Top
valign
(Center)
(Center)
Bottom
Bottom
Baseline
Baseline
[1] Value not yet supported.
11.2.3.2 The char and charoff attributes
Even simple word processors let you line up decimal points for numbers in a table. Up until the advent of the HTML 4.0 standard, the language was deficient in this feature. Now you may include the char attribute to indicate which letter in each of the table row's cells should be the axis for that alignment. You need not include a value with char. If you don't, the default character is language-based: it's a period in English, for example, and the comma in French. Include the char attribute and a single letter as its value to specify a different alignment character.
Use the charoff attribute and an integer number to specify the offset to the first occurrence of the alignment character on each line. If a line doesn't include the alignment character, it should be horizontally shifted to end at the alignment position.
The char and charoff attributes are new with HTML 4.0, and consequently not yet supported by any of the popular browsers. Nonetheless, you may someday use them to line up your decimals.
11.2.3.3 The bgcolor attribute
Like its relative for the