Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2009
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Fill Remaining Width?

    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)

    Code:
    <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

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,956
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Try setting the width explicitly as an attribute of your table tag.

  • Users who have thanked SB65 for this post:

    johnywhy (05-07-2011)

  • #3
    New Coder
    Join Date
    Jan 2009
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Thumbs up Correct

    thanks, that's it!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •