【发布时间】:2017-12-26 23:38:45
【问题描述】:
我有 2 个字段数量和价格。我基本上想将它们相乘并得到另一个名为 Price 的列的值(这是乘法的总和)。
我尝试过使用下面的 html 代码:
@Html.DisplayFor(modelItem => item.item_order_quantity*item.ITEM.item_price)
这是我的表格行代码:
<table class="table table-striped table-advance table-hover">
<tbody>
<tr>
<th><i class="icon_pin_alt"></i> Item Description</th>
<th><i class="icon_pin_alt"></i> Quantity</th>
<th><i class="icon_calendar"></i> Price</th>
</tr>
@foreach (var item in Model.ITEM_ORDER)
{
<tr>
<td style="width:auto">
@Html.DisplayFor(modelItem => item.ITEM.item_description)
</td>
<td style="width:auto">
@Html.DisplayFor(modelItem => item.item_order_quantity)
</td>
<td style="width:auto">
@Html.DisplayFor(modelItem => item.item_order_quantity*item.ITEM.item_price)
</td>
<td>
<div class="btn-group">
@Html.ActionLink("View", "Details", new { id = item.OrderID }) |
@Html.ActionLink("Edit", "Edit", new { id = item.OrderID }) |
@Html.ActionLink("Delete", "Delete", new { id = item.OrderID })
</div>
</td>
</tr>
}
</tbody>
</table>
【问题讨论】:
标签: html-table rows