用JSON文本动态创建DataGrid

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>表格</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!-- 引入css文件,无顺序 -->
    <link rel="stylesheet" href="themes/icon.css" type="text/css"></link>
    <link rel="stylesheet" href="themes/default/easyui.css" type="text/css"></link>
    
      <!-- 引入js文件,有顺序 -->
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/jquery.easyui.min.js"></script>

  </head>
  <body>
    
    
    <table border="2" align="center" class="easyui-datagrid">
        <thead>
            <tr>
                <th data-options="field:'id'">编号</th>
                <th data-options="field:'name'">姓名</th>
                <th data-options="field:'sal'">薪水</th>
                <th data-options="field:'sex'">性别</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>1</td>
                <td>哈哈</td>
                <td>6000</td>
                <td></td>
            </tr>
            <tr>
                <td>2</td>
                <td>呵呵</td>
                <td>7000</td>
                <td></td>
            </tr>
            <tr>
                <td>3</td>
                <td>嘻嘻</td>
                <td>8000</td>
                <td></td>
            </tr>
        </tbody>
    </table>
    
  </body>
</html>

 

posted on 2018-12-03 17:48  LoaderMan  阅读(230)  评论(0编辑  收藏  举报

导航