【发布时间】:2013-01-27 20:33:38
【问题描述】:
我有一个类似的表格,里面填满了数据
<table id="products-table" style="overflow-y:scroll" >
<thead>
<tr>
<th>Product (Parent Product)</th>
<th>Associated Sites</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@for (int i = 0; i < Model.Count(); i++)
{
<tr>
<td>
<a href="Edit"><strong>@Model.ElementAt(i).Name</strong></a><br />
</td>
<td>
<span class="lesser"></span>
</td>
<td>@Html.ActionLink("Edit Product", "Edit", "Products")<br />
@Html.ActionLink("Associate Site", "Associate", "Products")
</td>
</tr>
}
<tr>
</tbody>
</table>
和这样的 CSS
#products-table
{
width: 200px;
height: 400px;
overflow:scroll;
}
但滚动不起作用,我想修复表格的高度,如果超过,则使用滚动条
【问题讨论】:
-
一个非常好的实现(我认为)在这里发布:stackoverflow.com/a/57524791
标签: html css html-table