zoukankan      html  css  js  c++  java
  • mvc的视图中显示DataTable的方法

    mvc的视图中显示DataTable的方法:

    不断的循环画出table

    @{
        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">
  • 相关阅读:
    JQ 放大镜
    Jquery.tmpl
    Jquery Live方法
    Bootstrap之底层媒体查询
    Bootstrap 字体与图标
    工具提示
    模态框
    BootStrap格栅系统
    Tab选项卡
    弹出框
  • 原文地址:https://www.cnblogs.com/Percy_Lee/p/5396861.html
Copyright © 2011-2022 走看看