Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Fill Remaining Width?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32626
    johnywhy
    Participant

    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)







    my widget, which sets it's own width, and pushes the column as wide as necessary

    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, https://css-tricks.com, http://www.codingforums.com

    #46624
    DogsGhost
    Member

    give the table tag itself a set width and the td’s should sort themselves out.

    #77275
    TheLeggett
    Member

    Hey johnywhy,

    What you are describing sort of sounds similar to how tables will size by default when given 100% width. It’s a little confusing to understand what exactly you are trying to accomplish, so some more details might help :)

    To expand on that thought: you stated that you want column 1 to be determined by its contents, but column 2 to take up remaining space. How would that be different from column 2 being sized to its contents and column 1 taking up remaining space? An example of what you’re putting in both columns might be useful!

    Anyways, my gut reaction is that something as simple as giving your table width: 100% will do the trick.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.