我有一个表格,我不希望宽度小于540像素,在此表中,如果内容小于540像素宽,我希望单个列填充剩余宽度。
如果我将此列设置为宽度为99%,则可以在Firefox,Safari和Chrome中使用,但不能在Internet Explorer(任何版本)中使用,其中表格会增长到整页宽度。
我需要在IE7及以上版本中使用它。
编辑:
添加了一些代码:
<div class="container">
<table class="my-table">
<tr>
<td class="first"><img src="my-img.png"></td>
<td class="expand">Some text here... should grow</td>
<td class="meta">short text</td>
<td class="end-col">final column</td>
</tr>
</table>
</div>
CSS:
.container {
min-width: 540px;
display: inline-block;
}
.expand {
width: 99%;
}
.first,.meta和.end-col应该全部收缩包装到各自的内容。
这适用于除Internet Explorer之外的所有内容。