我在div中使表可滚动,一切正常,但表头太滚动了。我想固定表头。此表在div中呈现。我已经使用了PahingHelper模型进行分页。我曾尝试在表中使用可滚动但它也没有工作。所以,我在这里制作可滚动表。有没有办法让表格可滚动? //这是我滚动的示例代码
@model ShresthaTrade.Helper.PagingHelper
<table >
<tr>
<th>Brand</th>
<th>Machine Type</th>
<th>Machine Model</th>
<th>Machine Serial</th>
<th>Mac Address</th>
</tr>
</table>
<div style=" overflow:auto; height: 340px;">
<table >
<tbody>
@if (Model.Datatable.Rows.Count > 0)
{
foreach (System.Data.DataRow row in Model.Datatable.Rows)
{
<tr>
<td>@row["brand_name"]</td>
<td>@row["machine_type_name"]</td>
<td>@row["MachineModel"]</td>
<td>@row["MachineSerial"]</td>
<td>@row["MacAddress"]</td>
</tr>
}
}
else
{
<tr>
<td colspan="4">No records are found</td>
</tr>
}
</tbody>
</table>
</div>