EasyUi框架教学---网络表格的创建(班级管理实例)

在使用EasyUi的时候,注意两个方面,一就是修改charset--utf-8,二是request的路径要写对.

下面附上一段代码,详细解读一下.

<%@ page contentType="text/html; charset=UTF-8"%>//改成utf-8
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html >
    <head>
        <title>班级管理</title>
        <link rel="stylesheet" href="/TRAMS/css/easyui_old.css"  type="text/css" id="indexcssfile2"/>
        <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.min.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.easyui.min.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/js/easyui-lang-zh_CN.js"></script>
    </head>
    <body>
        <table class="easyui-datagrid"
                data-options="singleSelect:true,collapsible:true,url:'<%=request.getContextPath()%>/student?operateFlag=init',//取到的路径为当前用到的具体路径
                method:'get',fit:true,pagination://设置true将在数据表格底部显示分页工具栏。true,pageSize:5//页面大小,striped:true,//交替显示行背景pageList:[2,5,10]//页面显示的数据数量">
            <thead>
                <tr>
                    <th data-options="field:'id',width:'10%'">学号</th>//field指表字段名
                    <th data-options="field:'name',width:'10%'">姓名</th>
                    <th data-options="field:'sex',width:'10%',align:'right'">性别</th>
                    <th data-options="field:'age',width:'10%',align:'right'">年龄</th>
                    <th data-options="field:'begindate',width:'10%'">生日</th>
                    <th data-options="field:'score',width:'10%'">成绩</th>
                    <th data-options="field:'phone',width:'10%',align:'right'">电话</th>
                    <th data-options="field:'email',width:'10%'">邮箱</th>
                    <th data-options="field:'address',width:'10%'">地址</th>
                    <th data-options="field:'note',width:'10%',align:'right'">描述</th>
                </tr>
            </thead>
        </table>
    </body>
</html>

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值