2
<div>
<table >
<tr>
<th>Customer ID</th>
<th>Name</th>
<th>Type</th>
</tr>
@foreach (var a in Model.Attachments)
{
<tr>
<td>
@a.CId
</td>
<td>
<a href="@Url.Action("ViewAttachment", new { Id = a.CId })">@a.CName</a>
</td>
<td>
@a.CType
</td>
</tr>
}
</table>
@Html.PagedListPager((IPagedList)Model.Attachments, page => Url.Action("Index", new { page }))
</div>
当前我在显示25项每页。如果最后一个页面没有25个项目,我想将行追加到表格的最后,以将页面选择器保持在页面之间的同一级别。 这似乎是它的工作,我只是不知道在哪里把它:将行添加到页面列表的最后一页
@for (int i = 25; i > Model.Attachments.Count() % 25; i--)
{
<tr>
<td></td>
</tr>
}