【发布时间】:2018-10-02 06:42:09
【问题描述】:
我创建了一个 MVC Core Net 项目模板。我从脚手架创建了一个产品索引表。
如何在左侧添加一列,如红框所示?这不是侧面导航栏,而只是该页面特定类别左侧的一列。当用户向下滚动时,左列应该消失。它不应该被修复。
@model IPagedList<ElectronicsStore.Models.Product>
@{
ViewBag.Title = "Products";
int counter = 0;
}
@using X.PagedList;
@using X.PagedList.Mvc.Core;
<table class="table" >
<thead>
<tr>
<th class="col3">
@*@Html.DisplayNameFor(model => model.FirstOrDefault().ProductName)*@
</th>
<th class="col4">
@*@Html.DisplayNameFor(model => model.FirstOrDefault().ProductDescription)*@
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in ViewBag.OnePageOfProducts)
{
<tr>
<td class="col3">
<a href='@Url.Action("Details","Products" , new { id=item.ProductId })'>
<img src="~/images/@(item.ImageLocation)" data-holder-rendered="true" >
</a>
<div class="caption">
</td>
@*<td class="col3">
<img src="~/images/@(item.ImageLocation)" data-holder-rendered="true" />
</td>*@
<td class="col4">
<br />
@item.ProductName
</td>
</tr>
}
</tbody>
</table>
@Html.PagedListPager((IPagedList)ViewBag.OnePageOfProducts, page => Url.Action("Index", new { page }))
c# html css asp.net-mvc asp.net-core
【问题讨论】:
标签: c# html css asp.net-mvc asp.net-core