user1879988 user1879988 - 1 month ago 12
HTML Question

HTML Table auto size chrome

I have the following HTML-Code:


<table cellspacing="0" style="margin:0;padding:0;position:fixed;left:0px;top:0px;width:100%;height:100%;">
<tr style="padding:0px;margin:0px">
<td style="padding:0px;margin:0px;height:100%;width:50px;cursor:pointer;"></td>
<td style="padding:0px;margin:0px;height:100%;min-width:50px;"></td>
<td style="padding:0px;margin:0px;height:100%;width:50px;cursor:pointer;">< /td>
</tr>
</table>


It displays a table width 3 columns. The left and right one should have a fixed width. The middle one should enlarge automaticly. It works fine in FireFox, but not in Chrome.

Can anyone tell me why and how I could fix this?

Answer

This solves your problem for me.. adding a min and max width to the fixed columns and making the width auto on the central column

<table cellspacing="0" style="margin:0;padding:0;position:fixed;left:0px;top:0px;width:100%;height:100%">
    <tr style="padding:0px;margin:0px;">
    <td style="padding:0px;margin:0px;height:100%;min-width:50px;max-width:50px;cursor:pointer;width:50px"></td>
    <td style="padding:0px;margin:0px;height:100%;min-width:50px;width:100%"></td>
    <td style="padding:0px;margin:0px;height:100%;min-width:50px;max-width:50px;cursor:pointer;width:50px"></td>
    </tr>
    </table>