【问题标题】:Chrome - keep column width minimumChrome - 保持最小列宽
【发布时间】:2013-01-30 00:04:54
【问题描述】:

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

<!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 中获得预期的行为?

【问题讨论】:

    标签: html css google-chrome html-table


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:
      .limited {width:1px;overflow:hidden;}
      

      【讨论】:

        猜你喜欢
        • 2010-09-27
        • 2015-01-21
        • 2016-02-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-04-07
        • 1970-01-01
        • 2012-11-10
        相关资源
        最近更新 更多