html table cols mix % with pixels

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

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

thx in advance

Re: html table cols mix % with pixels wrote:

Quoted text here. Click to load it

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                  /
accessible web design: /

Now playing: Joan Jett - Love Me Two Times

Re: html table cols mix % with pixels

Quoted text here. Click to load it

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

Re: html table cols mix % with pixels

Quoted text here. Click to load it

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

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

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

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

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.

Site Timeline