<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>
現在、1 ページあたり 25 アイテムを表示しています。最終ページに 25 項目がない場合は、ページ セレクターをページ間で同じレベルに保つために、テーブルの最後に行を追加します。これはうまくいくようですが、どこに置くべきかわかりません:
@for (int i = 25; i > Model.Attachments.Count() % 25; i--)
{
<tr>
<td></td>
</tr>
}