HTML and CSS Reference
In-Depth Information
The
align
Attribute.
This attribute specifies the alignment of the table with the values
right
,
center
, and
left
. The table shown in Figure 8.6 has the
align
attribute set to
center
.
Figure 8.6
Centered table with
width
set to 75%
Even though it is still often used, the W3C has deprecated the use of the
align
attribute
with the
<table>
tag. Later in this chapter you'll use CSS to replace the functionality
of most of the table attributes—including configuring the horizontal alignment, borders,
width, padding, and background color of XHTML tables.
The
border
Attribute.
This attribute specifies whether and what type of visible border
the table will have. The value ranges from 0 to 100, with 0 indicating that no border
will be visible. The values between 1 and 100 determine the thickness of the visible
border, where 1 indicates a relatively thin border and 100 indicates a very thick border.
The table shown in Figure 8.7 has a border set to
10
.
Figure 8.7
Table with a border
set to
10
The browser determines the border color and shading based on the page background
color. If you want a specific color, also use the
bordercolor
attribute.
The
bordercolor
Attribute.
This attribute specifies the color of the border.
The values can be a color name or numeric value. See the color chart at
http://webdevfoundations.net/color.
The browser displays the border color as a solid
color and does not shade the border when the
bordercolor
attribute is used. The
Search WWH ::
Custom Search