Table
Support
Internet Explorer 2.0 fully supports HTML
tables according to the HTML 3.0 draft standard. Details of this standard are
available at http://www-uk.hpl.hp.com/people/dsr/html3/tables.html. |
As
shown here, Internet Explorer extends the table specification with three new
features. A table can be left- or right-aligned, just like a floating image, by
adding ALIGN=RIGHT to the opening TABLE tag. Also, by adding BGCOLOR=#nnnnnn
to each opening TD tag, each individual cell can have its own background color.
You can also add a caption to the table by using the CAPTION tag.
Here is the HTML entry that produces the table shown at right:
The following attributes remain with the lowest-level component if they are
nested. For example, TH and TD attributes override TR and TABLE attributes, and
TR attributes override TABLE attributes. For more information about TABLE, TR,
TH, and TD, please see the HTML 3.0 draft standard mentioned above.
|
|
Here is a complete description of the additional attributes supported by TABLE,
TR, TH, and TD. | |||
Attribute | Explanation | Example | Support |
---|---|---|---|
ALIGN=LEFT, or RIGHT | Specifies that the table or the text can be left- or right-aligned. The default is left-aligned for TABLE, TR, and TD. The default is center-aligned for TH. | <TABLE ALIGN=RIGHT BORDER=1
width=20%> <TR><TD>This table is right-aligned.</TD></TR></TABLE>
<TABLE BORDER=1 width=20%> <TR><TD ALIGN=RIGHT>The text in this cell is right-aligned.</TD></TR></TABLE> |
IExplore |
BGCOLOR= #rrggbb or colorname | Sets background color. rrggbb is a hexadecimal number denoting a red-green-blue color value (the pound sign is optional). BGCOLOR and each of the other color attributes here can also be set to a colorname. See Using Color. | <TABLE ALIGN=RIGHT BORDER=1
BGCOLOR=RED width=20%> <TR><TD>This table has a red background.</TD></TR></TABLE>
<TABLE ALIGN=RIGHT BORDER=1 width=20%> <TR><TD BGCOLOR=RED>This cell has a red background.</TD></TR></TABLE> |
IExplore |
BORDERCOLOR= #rrggbb or colorname | Sets border color and must be used with the BORDER attribute. rrggbb is a hexadecimal number denoting a red-green-blue color value (the pound sign is optional). BORDERCOLOR can also be set to a colorname. See Using Color. | <TABLE ALIGN=RIGHT BORDER=1
BORDERCOLOR=RED width=20%> <TR><TD>This table has a red border.</TD></TR></TABLE>
<TABLE ALIGN=RIGHT BORDER=1 width=20%> <TR><TD BORDERCOLOR=RED>This cell has a red border.</TD></TR></TABLE> |
IExplore |
BORDERCOLORLIGHT= #rrggbb or colorname | Sets independent border color control over one of the two colors used to draw a 3-D border, opposite of BORDERCOLORDARK, and must be used with the BORDER attribute. rrggbb is a hexadecimal number denoting a red-green-blue color value (the pound sign is optional). BORDERCOLORLIGHT can also be set to a colorname. See Using Color. | <TABLE ALIGN=RIGHT BORDER=1
BORDERCOLORLIGHT=RED width=20%> <TR><TD>This table has one half
of the 3-D border set to red.</TD></TR></TABLE>
<TABLE ALIGN=RIGHT BORDER=1 width=20%> <TR><TD BORDERCOLORLIGHT=RED>This cell has one half of the 3-D border set to red.</TD></TR></TABLE> |
IExplore |
BORDERCOLORDARK= #rrggbb or colorname | Sets independent border color control over one of the two colors used to draw a 3-D border, opposite of BORDERCOLORLIGHT, and must be used with the BORDER attribute. rrggbb is a hexadecimal number denoting a red-green-blue color value (the pound sign is optional). BORDERCOLORDARK can also be set to a colorname. See Using Color. | <TABLE ALIGN=RIGHT BORDER=1
BORDERCOLORDARK=RED width=20%> <TR><TD>This table has one half of
the 3-D border set to red.</TD></TR></TABLE>
<TABLE ALIGN=RIGHT BORDER=1 width=20%> <TR><TD BORDERCOLORDARK=RED>This cell has one half of the 3-D border set to red.</TD></TR></TABLE> |
IExplore |
VALIGN=TOP, or BOTTOM | Specifies that the text can be top- or bottom-aligned. The default is center-aligned. | <TABLE BORDER=1 width=20%
VALIGN=TOP><TR><TD>The text in this table is top-aligned.</TD></TR></TABLE>
<TABLE BORDER=1 width=20%><TR><TD VALIGN=TOP>The text in this cell is top-aligned.</TD></TR></TABLE> |
IExplore |
Specifies a caption for a table and must be used within the TABLE tag. | |||
Attribute | Explanation | Example | Support |
---|---|---|---|
ALIGN=LEFT, RIGHT, or CENTER | Draws the caption left-flush, right-flush, or centered with the table borders. | <TABLE><CAPTION ALIGN=CENTER>This caption will be centered between the left and right borders of the table.</CAPTION><TR><TD>This is a cell in the table.</TD></TR></TABLE> | HTML 3 |
VALIGN=TOP, or BOTTOM | Draws the caption on the top or the bottom of the table. | <TABLE><CAPTION ALIGN=CENTER VALIGN=BOTTOM>This caption will appear centered below the table.</CAPTION><TR><TD>This is a cell in the table.</TD></TR></TABLE> | HTML 3 |
Back to: | Table of Contents |
© 1996 Microsoft Corporation