setting the width of a table

Discussion in 'HTML' started by ppcguy, Jul 23, 2005.

  1. ppcguy

    ppcguy Guest

    is there a way i can set the width of a table to
    the min of a pre-defined pixel width or the page width.

    i.e. i'd like to set the width to lesser of 800 or the width.

    i'm trying to display some text - that i'd like to display
    right justified on the page and like it to be visible. the
    page itself could be wide - i.e. scrollbars.

    i'd like to avoid using frames.
    ppcguy, Jul 23, 2005
    #1
    1. Advertising

  2. Robert Frost-Bridges, Jul 23, 2005
    #2
    1. Advertising

  3. ppcguy

    Neredbojias Guest

    With neither quill nor qualm, Robert Frost-Bridges quothed:

    > ppcguy wrote:
    >
    > > is there a way i can set the width of a table to
    > > the min of a pre-defined pixel width or the page width.

    > [...]
    >
    > http://www.w3.org/TR/REC-CSS2/visudet.html#propdef-min-width


    Ahem. No, he needs to use max-width. <smug grin>

    table {
    width:100%;
    max-width:800px;
    }

    Of course this won't work in the redoubtable IE so a js routine will be
    required for that.

    --
    Neredbojias
    Contrary to popular belief, it is believable.
    Neredbojias, Jul 24, 2005
    #3
  4. Neredbojias wrote:


    > Ahem. No, he needs to use max-width. <smug grin>
    >
    > table {
    > width:100%;
    > max-width:800px;
    > }
    >
    > Of course this won't work in the redoubtable IE so a js routine will be
    > required for that.


    Ah of course. I read it t'other way round. Good job someone's awake.

    regards,
    --
    Robert
    http://brightonfixedodds.net
    Robert Frost-Bridges, Jul 24, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AndrewF
    Replies:
    1
    Views:
    744
    Bruce Barker
    Oct 10, 2005
  2. Sean Jorden
    Replies:
    1
    Views:
    586
    laurie
    Aug 19, 2003
  3. kris
    Replies:
    11
    Views:
    861
  4. ppcguy
    Replies:
    3
    Views:
    1,240
    Toby Inkster
    Aug 26, 2005
  5. Replies:
    0
    Views:
    489
Loading...

Share This Page