我有一個表,如:如何讓td內的div伸縮?
<table>
<tr>
<td>...</td>
<td><div class="stretch"></div></td>
</tr>
</table>
我需要得到.stretch
以適應td
的高度。目前div
的高度爲0.我錯過了什麼?
我有一個表,如:如何讓td內的div伸縮?
<table>
<tr>
<td>...</td>
<td><div class="stretch"></div></td>
</tr>
</table>
我需要得到.stretch
以適應td
的高度。目前div
的高度爲0.我錯過了什麼?
該TD必須有一個設定的大小 然後你設置div的高度:100%; 或繼承漂亮的同樣的事情 ,你會好起來
.stretch {
height: 100%;
}
這應該工作
<table style="width: 200px; height: 200px">
<tr>
<td style="border: thin solid #FF0000; height:200px">
<div style="border: thin solid #0000FF; width:100%; height:100%;">
</div>
</td>
</tr>
</table>
對不起,有什麼樣的表?你能發佈html/css嗎? – theazureshadow 2010-11-04 07:00:33
隱形question.huh? – klox 2010-11-04 07:04:22