【发布时间】:2016-11-07 12:13:52
【问题描述】:
在基于引导程序的网页上,我显示了下表:
这是使用以下代码生成的:
<div class="row">
<div class="col-lg-12">
<div class="table-responsive">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th class="text-right success">Count</th>
<th class="text-right success">Lower</th>
<th class="text-right success">Upper</th>
<th class="text-right success">Price</th>
<th class="text-right success">Cost</th>
</tr>
</thead>
<tbody>
@foreach (var dataRow in staffelData)
{
var differenceWithUpper = 0;
if (dataRow.Upper.HasValue)
{
differenceWithUpper = countValue - dataRow.Upper.Value;
}
else
{
differenceWithUpper = -1;
}
var cost = 0.0;
var inScope = 0;
if (differenceWithUpper >= 0)
{
inScope = dataRow.Upper.Value;
}
else
{
if (countValue >= dataRow.Lower.Value)
{
inScope = countValue - dataRow.Lower.Value;
}
}
cost = inScope * Decimal.ToDouble(@dataRow.PnrFee);
<tr>
<td class="text-right fit">@pnrsInScope</td>
@if (@dataRow.Lower.HasValue)
{
<td class="text-right fit">@dataRow.Lower.Value</td>
}
else
{
<td class="text-right fit">N/A</td>
}
@if (@dataRow.Upper.HasValue)
{
<td class="text-right fit">@dataRow.Upper.Value</td>
}
else
{
<td class="text-right fit">N/A</td>
}
<td class="text-right fit">@dataRow.Fee @dataRow.Currency</td>
<td class="text-right fit">@cost @dataRow.Currency</td>
</tr>
}
</tbody>
</table>)
</div>
</div>
</div>
不过,我仍然需要添加一项功能:我必须在同一张表中显示估计值。
估算值基于平均值,假设我们每天有 25 个订单,那么您预计当天会有 250 个订单。这 250 是我想在同一张表上显示的值。
我正在考虑在表格中画一条线@可以找到估计值的级别,并在该线上添加一个标签。
这里有人可以解释一下如何最好地完成这项工作吗?
【问题讨论】:
-
你是指另一列吗?
-
不,我的意思是实际上在高度上的列中画一条线,这将对应于估计值的值。 :)
标签: asp.net asp.net-mvc