homepage Welcome to WebmasterWorld Guest from 54.198.224.121
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: DrDoc

CSS Forum

    
td width
shell




msg:1192505
 4:05 pm on May 9, 2003 (gmt 0)

I have a table:

top cell
-----------------
right ¦ main
¦
¦

Whole table is to be 100%. Got this fine. Also the top cell to be 100%. Got this fine. But...

I want the right one to be 150px and the main to be the remaining width. (width="*" in HTML...). How do I do the equivilent of in CSS? Ie. Get that cell to be what ever width is left over?

Thank you! :)
Shell

 

drbrain




msg:1192506
 4:17 pm on May 9, 2003 (gmt 0)

Just don't specify a width for the main td, it will then get any remaining space that is left over in the table.

shell




msg:1192507
 4:52 pm on May 9, 2003 (gmt 0)

Oh, and I'm using col in stead of td, because when I originally did it in HTML, that didn't work.

I'll just try that (putting it in td.menu)...

shell




msg:1192508
 4:56 pm on May 9, 2003 (gmt 0)

Right. With just td.menu width set it acts as a % (yes I put 150px)!
With both set (td.menu and td.content [to 100%]), td menu width shrinks to that of the table (table.menu) with in it.

shell




msg:1192509
 6:20 pm on May 9, 2003 (gmt 0)

You won't see it change now as it's now doing the going to whatever size the internal table is! I want to do it this way, mainly because I understand everything this way. It should work, not just going to give up on it and chicken off onto another method. I'll go back to sticking it in the HTML if I have to.

SuzyUK




msg:1192510
 6:34 pm on May 9, 2003 (gmt 0)

shell...

as drbrain said: don't set a width on td.content it will auto fill

by saying you want it to be 100% it's trying to be...
and is overriding your 150px on the other cell...

table {width: 100%;}
td.menu {width: 150px;}
td.content {}

Suzy

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved