HTML and CSS Reference
In-Depth Information
10.2.1.11. The width and height attributes
Browsers automatically make a table only as wide as needed to correctly
display all of the cell contents. If necessary, you can make a table wider
with the width attribute.
The value of the width attribute is either an integer number of pixels or
a relative percentage of the screen width, including values greater than
100 percent. For example:
<table width=400>
tells the extended browser to make the table 400 pixels wide, including
any borders and cell spacing that extend into the outer edge of the
table. If the table is wider than 400 pixels, the browser ignores the at-
tribute. Alternatively:
<table width="50%">
tells the browser to make the table half as wide as the display window.
Again, this width includes any borders or cell spacing that extends into
the outer edge of the table and has no effect if the table normally is
more than half the user's current screen width.
Use relative widths for tables you want to resize automatically to the
user's window; for instance, tables you always want to extend across
the entire window ( <table width="100%"> ). Use an absolute width value
for carefully formatted tables whose contents become hard to read in
wide display windows.
Also with the popular browsers, you can use the nonstandard height
attribute to suggest a recommended height for the table. The browser
makes the table no shorter than this height but may make the table
taller if needed to contain the table's contents. This attribute is useful
when trying to stretch tables to fit in a frame or some specific area of
 
Search WWH ::




Custom Search