@{
ViewBag.Title = "ShowDataTable";
}
@using System.Data;
@model Models.ConModel
@{
var table = Model.ExcelTable as DataTable;
}
<script src="~/Scripts/My97DatePicker/WdatePicker.js"></script>
<table border=1 cellspacing=0 cellpadding=2>
<thead>
<tr>
@foreach (DataColumn dc in table.Columns)
{
<th>
@dc.ColumnName
</th>
}
</tr>
<tbody>
@foreach (DataRow dr in table.Rows)
{
<tr>
@foreach (DataColumn d in table.Columns)
{
<td>
@dr[d.ColumnName]
</td>
}
</tr>
}
</tbody>
</thead>
</table>
<script type="text/javascript">
@{
ViewBag.Title = "ShowDataTable";
}
@using System.Data;
@model Models.ConModel
@{
var table = Model.ExcelTable as DataTable;
}
<script src="~/Scripts/My97DatePicker/WdatePicker.js"></script>
<table border=1 cellspacing=0 cellpadding=2>
<thead>
<tr>
@foreach (DataColumn dc in table.Columns)
{
<th>
@dc.ColumnName
</th>
}
</tr>
<tbody>
@foreach (DataRow dr in table.Rows)
{
<tr>
@foreach (DataColumn d in table.Columns)
{
<td>
@dr[d.ColumnName]
</td>
}
</tr>
}
</tbody>
</thead>
</table>
<script type="text/javascript">
标签:显示,DataColumn,dc,MVC,foreach,table,dr,DATATABLE,Columns From: https://www.cnblogs.com/qiu18359243869/p/16759041.html