jquery.dataTables的使用方法

<script src="https://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.11/css/jquery.dataTables.min.css">

<table id="browsePeopleTable">
    <thead>
    <tr>
        <th>抽奖人姓名</th>
        <th>电话号码</th>
        <th>推荐码</th>
        <th>QQ号码</th>
        <th>浏览时间</th>
    </tr>
    </thead>
    <tbody></tbody>
</table>


$('#mydatatable').DataTable({
    data: data,
    "aoColumns": [
        {"mDataProp": "name"},
        {"mDataProp": "createtime"},
        {"mDataProp": "counter"},
        {
            "mDataProp": "userid",
            //隐藏列
            "render": function (obj) {
                return "<input type='hidden' value=" + obj + "><span style='color: red;'>查看</span>";
            }
        }
    ],
    "iDisplayLength": 15,
    "oLanguage": {
        "sProcessing": "正在加载中......",
        "sLengthMenu": "每页显示 _MENU_ 条记录",
        "sZeroRecords": "对不起,查询不到相关数据!",
        "sEmptyTable": "表中无数据存在!",
        "sInfo": "当前显示 _START_ 到 _END_ 条,共 _TOTAL_ 条记录",
        "sInfoFiltered": "数据表中共为 _MAX_ 条记录",
        "sSearch": "搜索",
        "oPaginate": {
            "sFirst": "首页",
            "sPrevious": "上一页",
            "sNext": "下一页",
            "sLast": "末页"
        }
    } //多语言配置
});

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值