2013-02-14 68 views
0

我有一个“有限宽度”和“宽度”列的表格。预期的行为是在调整表格大小时,有限宽度列变得尽可能最小,而宽度列适合可用空间。html - chrome - 保持列宽度最小值

<!DOCTYPE html> 
<style> 
.limited {width:0;overflow:hidden;} 
.wide {overflow:hidden;} 
.limited div, .wide div {max-width:10em;white-space:nowrap;} 
table {width:100%;} 
</style> 
<table id="example" border="1"> 
    <thead> 
     <tr> 
      <td class="limited"><div>veeeeeeee eeeeeeee eeeeee eeeeeeeeery</div></td> 
      <td class="wide"><div>looooooooo ooooooooooo oooooooooooooooooo ooooooooooooooooo ooooooong</div></td> 
      <td class="limited"><div>text</div></td> 
     </tr> 
    </thead> 
</table> 

复制的代码在Firefox和IE9中的行为与预期相同,但不在chrome中。我如何在Google Chrome中预期行为? {

回答

0

.limited {width:1%;溢出:隐藏; }

0
.limited {width:1px;overflow:hidden;}