html table cols mix % with pixels

Discussion in 'HTML' started by ptdorf@gmail.com, Mar 6, 2007.

  1. Guest

    can anyone tell me how can i control the table columns width both in
    pixels and %?

    thx in advance
     
    , Mar 6, 2007
    #1
    1. Advertising

  2. Els Guest

    wrote:

    > can anyone tell me how can i control the table columns width both in
    > pixels and %?


    It would help if you'd explain it some more. Now I have to guess that
    you want the columns to have percentage widths, but never get narrower
    than a certain amount of pixels, probably because you have pictures in
    them or something.

    If my guess was right, the answer is called min-width. Won't work in
    IE6/5, but there are workarounds for that. I guess my guess is wrong
    though, because table columns by nature can't get any smaller than any
    fixed width content that's in it. Care to explain what you meant?

    --
    Els http://locusmeus.com/
    accessible web design: http://locusoptimus.com/

    Now playing: Joan Jett - Love Me Two Times
     
    Els, Mar 6, 2007
    #2
    1. Advertising

  3. Ben C Guest

    On 2007-03-06, <> wrote:
    > can anyone tell me how can i control the table columns width both in
    > pixels and %?


    You can mix them up all you like, e.g.

    <tr>
    <td style="width: 200px">...</td>
    <td>another cell</td>
    </tr>
    <tr>
    <td style="width: 50%">...</td>
    <td>another cell</td>
    </tr>

    and the browser will bend over backwards to try to make as much as what
    you've asked for as close to true as possible, even where it's self
    contradictory.

    You can't set percentage and pixel width at the same time on the same
    _cell_, but you can do that on two cells in the same column, which is
    effectively asking both for a width and a percentage width on that
    column.

    For example in this case, the browser might stretch the second
    auto-width column to make 200px and 50% both true, provided there's
    400px available.

    I would say though it's better not to rely on this kind of thing. If
    it's specified, I don't know where, and you can expect to find
    differences between browsers. Simple is best.
     
    Ben C, Mar 6, 2007
    #3
  4. Guest

    > It would help if you'd explain it some more. Now I have to guess that
    > you want the columns to have percentage widths, but never get narrower
    > than a certain amount of pixels, probably because you have pictures in
    > them or something.


    sorry for the late reply.... (lately i'm very busy)

    i have a html grid, the 1st column being the check box, followed by
    many others like name, email, status
    i'd like that some cols have fixed width (pe status: 50px, image
    120px), others to have a pc width (pe name, email: 20%) and, at least,
    one free width (pe description). basically, im concerned with resizing
    the grid: the fixed cols wouldnt move (coz they have the exact/max
    width for them).

    thx a million
     
    , Mar 28, 2007
    #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. PontiMax
    Replies:
    0
    Views:
    416
    PontiMax
    Jan 12, 2005
  2. Aaron Fude
    Replies:
    5
    Views:
    1,283
    Aaron Fude
    May 21, 2004
  3. phl
    Replies:
    2
    Views:
    1,992
  4. HP
    Replies:
    3
    Views:
    427
    Ben C
    Mar 9, 2007
  5. solenero

    resizable table cols

    solenero, Oct 11, 2005, in forum: Javascript
    Replies:
    1
    Views:
    320
    Baconbutty
    Oct 12, 2005
Loading...

Share This Page