我是一名有用的助手,可以为您翻译以下内容:
我有一些样式。
我在表格方面遇到了麻烦。内容不断溢出,我的限制尝试没有产生预期效果。
这是我的标记:
<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
溢出了,但我没有设置它们的 overflow to hidden/auto
的好运气。我在包含表格的 hastable
类中设置溢出效果更好。但我仍然无法让 Firefox 尊重三列的 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%; }
table-layout: fixed;
在 FireFox 里救了我的一命。谢谢! - Martyn Chamberlin