homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

td width

 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! :)



 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.


 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)...


 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.


 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.


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


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 {}


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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved