Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > table formatting question

table formatting question
Thread Tools
n~s
Forum Regular
Join Date: Jan 2003
Status: Offline
Reply With Quote
Mar 26, 2003, 11:56 AM
 
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.
     
philzilla
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Mar 26, 2003, 12:20 PM
 
[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
     
pahroza
Dedicated MacNNer
Join Date: Feb 2001
Location: Atlanta, GA
Status: Offline
Reply With Quote
Apr 1, 2003, 09:28 PM
 
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 <>
     
pahroza
Dedicated MacNNer
Join Date: Feb 2001
Location: Atlanta, GA
Status: Offline
Reply With Quote
Apr 1, 2003, 09:29 PM
 
Ooops, dupe.
     
der Kopf
Fresh-Faced Recruit
Join Date: Aug 2002
Status: Offline
Reply With Quote
Apr 4, 2003, 08:48 AM
 
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...
     
Simon Mundy
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Apr 4, 2003, 10:28 AM
 
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 Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 11:18 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,