- I have a table element contained in a div and the table is set a width of 100%.
- The div element is reduced in width whenever the browser width reduces.
- In Chrome, Safari,开发者_Python百科 Firefox and IE7 when the div get resized, the table also is resized.
- But in IE8, though, the table remains without being resized and overflows the container div
Following is the structure I am dealing with
<div style="width:500px">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tbody>
<tr>
<td valign="top">
<div>My table column contents</div>
</td>
<td valign="top">
<div>My table second column contents</div>
</td>
</tr>
</tbody>
</table>
</div>
You have the table wrapped in a div with a defined width. Just define the width of the table too.
精彩评论