I have an HTML table that has rows added in a PHP loop. This is what the loop body looks like
<tr>
<td style="width:220px"><?php echo $a; ?></td>
<td style="width:150px"><?php echo $b; ?></td>
<td style="width:70px"><?php echo $c; ?></td>
<td style="width:70px"><?php echo $d; ?></td>
</tr>
The problem is, when the contents in the second column of any row are slightly large, the width of the second column exceeds 150px, and to compensate the width of the first column reduces. How can I prevent that from happening. I want to widths to not change, and if the contents in any particular cell are too large to fit, the height should increase to accomodate.
you should try this CSS instruction:
that works in many browsers (yes, including IE 6, even IE 5.5 but not Fx 3.0. It’s only recognized by Fx3.5+. Also good for Saf, Chr and Op but I don’t know the exact version for these ones) and don’t do any harm in the other ones.
If table’s width is still messed up, there is also:
that will force the browser to use the other table algorithm, the one where it doesn’t try to adapt many situations including awkward ones but stick to what the stylesheet says.