JSON値を取得してテーブルに挿入していますが、テーブルを表示するときに水平スタイルを垂直に変更する必要があります。 MVCコントローラを使用してモデルを更新し、モデルデータをtable.unbleに割り当てて、最初の列にシリアル番号を取得しています。htmlテーブルの水平行から垂直列のデータ表示を変更する方法
私はこのような表を表示したい:
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>
は、1.binid 0,1,2,3から行うことができます。 – Swapna
+1を{item.i + 1}に追加する
0 + 1 – Swapna