这似乎是一个琐碎的问题,但是我需要打印表中的“
<table class="table table-condensed table-responsive table-striped">
@{ var previousheader = ""; }
@foreach (var item in Model)
{
if (item.TrmnlGrp_Description_TEMP != "" && item.TrmnlGrp_Description_TEMP != previousheader)
{
previousheader = item.TrmnlGrp_Description_TEMP;
<tr>
<td colspan="6" style="padding:5px; background:#808080">
<b>@Html.DisplayName(item.TrmnlGrp_Description_TEMP)</b>
</td>
<td style="padding:5px; background:#808080">
<input type="button" name="print" value="Print" />
</td>
</tr>
<tr>
<th>
Vendor
</th>
<th>
Terminal
</th>
<th>
Eff. Date
</th>
<th>
Diesel
</th>
<th>
Regular
</th>
<th>
Mid
</th>
<th>
Premium
</th>
</tr>
}
else
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Vend_Description_TEMP)
</td>
<td>
@Html.DisplayFor(modelItem => item.Trmnl_Description_TEMP)
</td>
<td>
@Html.DisplayFor(modelItem => item.Fuelcost_EFF_DateTime_TEMP)
</td>
<td>
@Html.DisplayFor(modelItem => item.Diesel)
</td>
<td>
@Html.DisplayFor(modelItem => item.Regular_Unleaded)
</td>
<td>
@Html.DisplayFor(modelItem => item.Midgrade_Gasoline)
</td>
<td>
@Html.DisplayFor(modelItem => item.Premium_Unleaded_Gas)
</td>
</tr>
}
}
</table>