...

View Full Version : Fill Remaining Width?



johnywhy
05-07-2011, 07:15 AM
howdy, y'all

i have a table (don't freak out!) with 2 columns.

i do not want to specify width for either.

rather i want column 1 width to be determined by it's contents.

i want column 2 to fill to use all remaining available width.

can i do this with max-width?

my attempt (which doesn't work)


<table>
<tr>
<td id="column1">
[[my widget, which sets it's own width, and pushes the column as wide as necessary]]
</td>
<td id="column2" style="max-width:100%">
My content, which naturally wraps to column width
</td>
</tr>
</table>

the undesirable result is that column2 does not fill all remaining available width, it just expand to fit its own content, like column1.

posted on http://welovecss.com, http://csscreator.com, http://css-tricks.com, http://www.codingforums.com

SB65
05-07-2011, 01:19 PM
Try setting the width explicitly as an attribute of your table tag.

johnywhy
05-07-2011, 06:47 PM
thanks, that's it!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum