SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member bushbass's Avatar
    Join Date
    May 2003
    Location
    Parsippany, NJ
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    max-width table or div

    I've been trying all morning to figure out if this is possible.

    The content portion of my page is currently a 1 cell table at 90% width. (I know I should do that with css, It's an old design and I haven't had time) Works fine on up to about 800x600, but larger than that the text gets too stretched out. Is there some way to set the maximum width of the table to 750px but have it reamain liquid at narrower resolutions?

    Here is an example page from the site:
    http://www.bushwackers.org/member/openhouse2004.html
    Alex Nielsen

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Yes!
    Code:
    table {
      width: 90%;
      /*max-width doesn't work in IE/Windows,
      but will work in all other browsers*/
      max-width: 750px;
    }

  3. #3
    SitePoint Member bushbass's Avatar
    Join Date
    May 2003
    Location
    Parsippany, NJ
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vgarcia
    *max-width doesn't work in IE/Windows,
    but will work in all other browsers*
    Damn, I new you were going to say that. Anyone have a cross browser solution?
    Alex Nielsen

  4. #4
    SitePoint Member bushbass's Avatar
    Join Date
    May 2003
    Location
    Parsippany, NJ
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    solution!

    Quote Originally Posted by bushbass
    Damn, I new you were going to say that. Anyone have a cross browser solution?
    Someone on another message board came up with this solution:

    Posted: Tue Oct 21, 2003 12:25 pm
    Post subject: Done!

    --------------------------------------------------------------------------------

    Finally got it, works IE 6 anyways but I haven't tested in other versions or other browsers. It does look fairly safe IMO.

    Quote:
    <body><table cellpadding="1%">
    <tr>
    <td width="755">text text text text text text
    text text text text text text text text text text text text text text text text
    text text text text text text text text text text text text text text text text
    text text text text text text text text text text text text text text text text
    text text text text text text text text text text text text text text text text text text text text
    text text text text text text
    text text text text text text text text text text text text text text text text
    text text text text text text text text text text text text text text text text
    text text text text text text text text text text text text text text text text
    text text text text text text text text text text text text text text text text text text text text
    </td>
    <td width="1%">&nbsp;</td></tr></table>

    </body>


    Please let me know....
    _________________
    Always do right - this will gratify some and astonish the rest.
    --Mark Twain

    http://factor1.net/
    My soon to be 'Real' site.(Jan. 1st launch - good stuff up there now to keep amused by)
    Alex Nielsen


Bookmarks

Posting Permissions

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