2013-02-14 76 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;}