2010-07-08 55 views
0

我在布局中遇到了IE6问题。 下面是示例。在IE6中使用表格固定在div中的HTML表格

<div style="overflow:hidden;"> 
    <table style="table-layout: fixed;" width="100%" border="0" cellpadding="4" cellspacing="0"> 
        <colgroup> 
         <col width="30px" /> 
         <col width="100px" /> 
         <col width="200px" /> 
         <col width="150px" /> 
         <col width="300px" /> 
         <col width="320px" /> 
         <col /> 
        </colgroup> 
        <tr> 
         <td> 
          &nbsp; 
         </td> 
         <td class="gridHeader"> 
          Condition 
         </td> 
         <td> 
          Condition Description 
         </td> 
         <td> 
          Fixed Item 
         </td> 
         <td> 
          Optional Item 
         </td> 
         <td> 
         </td> 
        </tr> 
       </table> 
      </div> 

在IE6中,当我尝试调整浏览器的宽度要小(或当数列超过了浏览器的宽度),当DIV打到最右列,它停止调整大小和出现的浏览器滚动这不应该发生。 有没有人知道这个解决方法?任何建议将被认真考虑。

问候, 不然闵

+0

我想你不能发现很多问题,如果使用mozilla firefox .. – klox 2010-07-08 04:12:07

回答

1

什么是你想要的行为?因为您正在使用像素来固定列的宽度,所以浏览器的双手是捆绑在一起的。它不能缩小尺寸。如果您喜欢流体布局,请使用百分比。如果您想在IE6中模仿max-width,则需要依靠JavaScript

+0

表的宽度应该是固定的。只是当浏览器调整大小时div的大小缩小时表格不会溢出。它适用于除IE6以外的任何其他浏览器。 – 2010-07-10 05:06:49