Welcome to WebmasterWorld Guest from 54.227.52.24

Forum Moderators: not2easy

Message Too Old, No Replies

td width

     

shell

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

10+ Year Member



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

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

WebmasterWorld Senior Member 10+ Year Member



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

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

10+ Year Member



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

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

10+ Year Member



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

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

10+ Year Member



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

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

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



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

 

Featured Threads

Hot Threads This Week

Hot Threads This Month