【发布时间】:2010-12-11 12:59:40
【问题描述】:
我无法让我的表正常运行。内容不断溢出,我试图限制它并没有产生预期的效果。
这是我的标记:
<div class="repeatingdiv">
<div class="hastitle">Some title</div>
<div class="hastable">
<table>
<thead><tr><th></th></tr></thead>
<tfoot><tr><th></th></tr></tfoot>
<tbody>
<tr>
<td class="col1">Col 1</td>
<td class="col2">Col 2</td>
<td class="col3">Col 3</td>
</tr>
</tbody>
</table>
</div>
</div>
然后我就有了一些风格。 td's 溢出了,但我没有运气设置他们的overflow to hidden/auto。在包含该表的 hastable 类中设置溢出确实有更好的运气。但我仍然无法让Firefox 尊重 3 列的width 分布:30%, 35%, 35%。我也尝试设置min-width,但仍然没有运气。我在页面上有几个这样的表格,每个表格都有自己的宽度。对这个乱七八糟的桌子有什么帮助吗?
.repeatingdiv { }
.hastitle { margin:0 10px; padding:3px 3px 1px 6px; }
.hastable { overflow:hidden;
text-overflow: ellipsis;
margin:10px;
padding:10px;
}
table { }
table tbody { width: 100%; }
tr { width: 100%; }
td.col1 { width:30%; min-width:30%; }
td.col2 { width:35%; min-width:35%; }
td.col3 { width:35%; min-width:35%; }
【问题讨论】:
标签: css firefox html-table overflow