Razor 遍历 DataTable
@using System.Data
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
@foreach (System.Data.DataColumn column in Model.dt.Columns)
{
<th>@column.ColumnName</th>
}
</tr>
</thead>
<tbody>
@foreach (System.Data.DataRow row in Model.dt.Rows)
{
<tr>
@foreach (var cell in row.ItemArray)
{
<td>@cell.ToString()</td>
}
</tr>
}
</tbody>
</table>