Old 18-02-2007, 02:03   #1 (permalink)
Ayman
Registered User
 
Join Date: Feb 2007
Posts: 2
Stretching a table vertically

Hi guys. This is my first post, so be nice to me . Looks like a pretty active forum..



I know that when I specify a width of 100% for a table, it stretches horizontally to the extends of the browser . And as you resize the browser, the table resizes as well.



Why am I not getting this effect when specifyign a height of 100% ?? The table does not stretch vertically ! It's driving me nuts. Any explanation? + do you know a way to make the table (in case it's small) to stretch vertically to the end of the browser???



Ayman
  Reply With Quote
Old 18-02-2007, 04:51   #2 (permalink)
datahound
Spare Parts
 
datahound's Avatar
 
Join Date: Jan 2005
Location: Bracknell Forest
Posts: 4,739
Try removing the doctype. This is not good practice but it will make it work.

More here.
http://apptools.com/examples/tableheight.php
__________________
  Reply With Quote
Old 18-02-2007, 05:49   #3 (permalink)
Dusteh
Sir digby chicken caesar
 
Dusteh's Avatar
 
Join Date: Sep 2004
Posts: 4,404
i'm guessing you shouldn't need to be using tables for this anyway ... have a look at this instead: http://www.xs4all.nl/~peterned/examples/csslayout1.html
__________________
unconsolidated isoparms
  Reply With Quote
Old 18-02-2007, 06:54   #4 (permalink)
skyrocket
SkyRocket Design
 
skyrocket's Avatar
 
Join Date: Aug 2005
Location: Chichester
Posts: 538
Quote:
Originally Posted by Ayman
Why am I not getting this effect when specifyign a height of 100% ?? The table does not stretch vertically ! It's driving me nuts. Any explanation? + do you know a way to make the table (in case it's small) to stretch vertically to the end of the browser???

put some content in it. sounds like you're using the table to layout your page which is not good practice in the first place (the interweb police will book you and your name will go up in the hall of shame). tables were only originally designed to display tabular data so they will only stretch down to fill the content supplied. if the content ends before the end of the page what is the table going to do - grow some more rows and cells automagically? they do stretch sideways but not vertically (AFAIK) so i can see why it is driving you bonkers. The solution... - red pill or blue pill?? If you want to enter the matrix and fight the machines from the inside then use divs not tables for page layout
  Reply With Quote
Old 19-02-2007, 00:47   #5 (permalink)
Ayman
Registered User
 
Join Date: Feb 2007
Posts: 2
I did try learning it once. IT HAS AN INCREDIBLE LEARNING CURVE !!

Tables are so straight forward. I did once reach a good level with divs, but then I find that the information never finishes, and people propose tricks and I dont know what. Do you guys feel that?
  Reply With Quote
Old 19-02-2007, 05:43   #6 (permalink)
skyrocket
SkyRocket Design
 
skyrocket's Avatar
 
Join Date: Aug 2005
Location: Chichester
Posts: 538
yes. for the folks who've been through the betty ford tables addiction clinic it is a hard habit to get rid of. it's not easy but keep persisting and the penny will drop. it's all a matter of shifting your mindset grasshopper. don't settle for the easy option. there's websites out there which will teach you how to layout a page using divs (that stretch all the way down to the bottom of the page) - just google css 2 column layout (or 3 column layout even)
  Reply With Quote
Old 19-02-2007, 10:51   #7 (permalink)
pgo
misanthrope
 
pgo's Avatar
 
Join Date: Jan 2005
Posts: 12,269
Quote:
Originally Posted by Ayman
I did try learning it once. IT HAS AN INCREDIBLE LEARNING CURVE !!

Tables are so straight forward. I did once reach a good level with divs, but then I find that the information never finishes, and people propose tricks and I dont know what. Do you guys feel that?
Yes, they're straightforward, but they're frowned upon as a layout device by anyone who knows their stuff. For your own sake, you should learn the proper way to build websites.

It can be frustrating to relearn everything, but at least you'll be employable.

You don't design anything with "divs". I'm sick and tired of people not even getting the simple distinction:

(X)HTML is for content.
CSS is for looks.

You don't "use divs" to mark up a document - you use what's appropriate to the content: p, h1, h2, dl, ol, ul, blockquote, etc - with the occasional div to create high-level divisions of the page (if need be). Then add CSS to make it look pretty.

It's not that complicated: www.htmldog.com
__________________
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8