我創建了一個HTML表格迴應,我想設置一個max-height
和height
性能,它
但該表不接受他們
我使用此代碼
HTML表不以CSS屬性
<table class="table table-striped table-hover" id="Table">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
<th>Column 4</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 0 0</td>
<td>Row 0 1</td>
<td>Row 0 2</td>
<td><a id="table-buttons" class="btn btn-primary">Row 0 3</a></td>
</tr>
<tr>
<td>Row 1 0</td>
<td>Row 1 1</td>
<td>Row 1 2</td>
<td><a id="table-buttons" class="btn btn-primary">Row 1 3</a></td>
</tr>
<tr>
<td>Row 2 0</td>
<td>Row 2 1</td>
<td>Row 2 2</td>
<td><a id="table-buttons" class="btn btn-primary">Row 2 3</a></td>
</tr>
</tbody>
</table>
CSS
#Table {
width: 600px;
max-width: 600px;
height: 210px;
max-height: 210px;
overflow-y: auto;
}
td {
width: 150px;
max-width: 150px;
}
指定height
和max-height
一定不能讓表進行比這三行越來越頭
但是當我添加其他行的表 完全無視height
和max-height
和擴展以適應四行
我想表顯示滾動條爲overflow-y: auto
財產
的結果,但並沒有發生
我使用這Bootstrap風格
請幫助
你是如何,包括你的CSS? – jmargolisvt
是的,我包括它 –