Welcome to WebmasterWorld Guest from 54.226.238.178

Forum Moderators: not2easy

Message Too Old, No Replies

td width

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

New User

10+ Year Member

joined:May 9, 2003
posts:21
votes: 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

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 18, 2003
posts:827
votes: 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)

New User

10+ Year Member

joined:May 9, 2003
posts:21
votes: 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)

New User

10+ Year Member

joined:May 9, 2003
posts:21
votes: 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)

New User

10+ Year Member

joined:May 9, 2003
posts:21
votes: 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)

Senior Member

WebmasterWorld Senior Member suzyuk is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Oct 1, 2002
posts:5199
votes: 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