|
|
table formatting question
|
|
|
|
Forum Regular
Join Date: Jan 2003
Status:
Offline
|
|
I want to use a table to fill a web page. Is there something I can do to make the table's width adjust itself to equal the width of the browser window?
Googled without success. TIA for any help.
|
|
|
|
|
|
|
|
|
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status:
Offline
|
|
[table width="100%" height="100%" border=0 cellpadding=0 cellspacing=0]
[tr]
[td]
[/td]
[/tr]
[/table]
|
"Have sharp knives. Be creative. Cook to music" ~ maxelson
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Feb 2001
Location: Atlanta, GA
Status:
Offline
|
|
In addition to the above, you may also want to set the following attributes to the body tag:
[body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0"]
Of course, change the [] to <>
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Feb 2001
Location: Atlanta, GA
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Aug 2002
Status:
Offline
|
|
Originally posted by philzilla:
[table width="100%" height="100%" border=0 cellpadding=0 cellspacing=0]
Of course, like that, your HTML won't validate, and you'll be laden with all the sins of Sodom & Gomorra by web evangelists. Or won't you? Width and height ARE deprecated tags.
The way I do it is with css, it's as easy as writing
[table style="height:100%; width:100%;"]
One thing: it helps, if you want full width and height, to put the following in the body tag
[body style="padding:2px;"]
or a little more. It will put 2 pixels at top, left, bottom, right, so your table will still be centered, but the advantage is that this prevents scroll-bars from appearing in many browsers (scroll-bars, moreover, that you cannot get out by resizing the window, I think IE is quite good at that), as if your table where actually larger than 100%.
It's a quirky world we live in...
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status:
Offline
|
|
Originally posted by n~s:
I want to use a table to fill a web page. Is there something I can do to make the table's width adjust itself to equal the width of the browser window?
Googled without success. TIA for any help.
Are you sure that a table at 100% is the best way technically to achieve want you want? With the utmost respect, perhaps the design may need some rethinking if it depends on it?
|
Computer thez nohhh...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|