View Full Version : Fill Remaining Width?

05-07-2011, 08: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)

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

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

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

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