<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": "末页" } } //多语言配置 });
jquery.dataTables的使用方法
最新推荐文章于 2024-08-01 11:09:48 发布