html table cols mix % with pixels

P

ptdorf

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

thx in advance
 
E

Els

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?
 
B

Ben C

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.
 
P

ptdorf

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top