【发布时间】:2013-03-18 23:14:23
【问题描述】:
我正在尝试加载模型并将每个模型设置为单独的 <td> 当我达到 5 <td> 我想自动启动一个新的 <tr> 但它并不能真正使用 if 语句。有可能还是我应该采用完全不同的方法?
这是我的代码:
<tr>
@for (int i = 0; i < Model.Count; i++)
{
<td>
<img width="200px" src="@Url.Action("GetImage", "Beheer", new { productId = Model[i].product_id }) " alt="pasfoto"/><br />
<center><b>@Html.ActionLink(Model[i].naam, "PrProduct", "Categorie", new { id = Model[i].product_id }, null)</b></center>
<center>€ @Html.Label(Model[i].prijs)</center>
</td>
}
</tr>
【问题讨论】:
-
您是否也忘记了
C#标签? -
是的,但它更多的是关于表格而不是关于 c# 代码,可以是任何类型的代码。
标签: c# html html-table