【发布时间】:2017-07-16 02:27:56
【问题描述】:
我正在获取 JSON 值并填充到表格中,但是在显示表格时我需要将水平样式更改为垂直。我正在使用 MVC 控制器并更新模型,并将模型数据分配给 table.unble 以在我的第一列中获取序列号。
我想这样显示表格:
name deviceid time location status
1 123 10.50 kolkata 23
2 2332 11.11 hyderabad 44
3 333 04.54 chennai 11
but im getting the table format like this
name deviceid time location status
1 123 10.50 kolkata 23
1 2332 11.11 hyderabad 44
1 333 04.54 chennai 11
<table class="table table-striped">
<thead>
<tr class="success">
<th>Bin id</th>
<th>device id</th>
<th>filled in %</th>
<th>Updated time</th>
<th>Area</th>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr> <td class="success">1</td>
<td class="success">@item.deviceid</td>
<td class="danger">@item.Filled.ToString("N2") %</td>
<td class="info">@item.UpdatedTime</td>
<td class="warning">@item.Area</td>
</tr>
}
</tbody>
</table>
【问题讨论】:
标签: c# html css model-view-controller