我在Google上發現了很多關於這個問題的答案,但它們都不適用於所有瀏覽器。在IE6,7和8中的CSS最小寬度
我正在尋找一種僅限於CSS的方式來獲取Firefox,IE6,IE7和IE8上的最小寬度工作。衆所周知,IE不支持最小寬度,所以有幾個黑客試圖模仿最小寬度的行爲。不幸的是,我對他們沒有任何運氣。
具體來說,這就是我想要做的事:
<style type="text/css">
table.dataTable td {
white-space: nowrap;
}
table.dataTable td.largeCell {
white-space: normal;
min-width: 300px;
}
</style>
<table class="dataTable">
<tr>
<td>ID</td>
<td>Date</td>
<td>Title</td>
<td class="largeCell">A large amount of data like a description that could
span several lines within this cell.</td>
<td>Link</td>
</tr>
</table>
沒有人有辦法得到這個工作?
IE> = 7支持'min-width'(儘管版本7中有bug)。它已經被Firefox支持很久了。 – Quentin 2010-03-01 14:52:14
Firefox不是問題。這只是我需要一個可以在所有這些瀏覽器上運行的解決方案。 另外,我在IE8中測試'min-width',它不適合我。 – Aaron 2010-03-01 14:59:00
對於所有回答的人,我正在努力嘗試解決方案。 – Aaron 2010-03-01 15:25:41