标签:
<html>
<head></head>
<script type="text/javascript"> $(document).ready(function () { $("#datatable1").dataTable({ "bPaginate": true,//开关是否分显示页器 "bInfo": true,//开关,是否显示表格的一些信息 "bFilter": true,//开关,是否启用客户端的过滤器 "sDom": "<>Ifrtip<>", "bAutoWith": false, "bDeferRender": false, "bJqueryUI": false,//开关,是否启用jQueryUI风格 "bLengthChange": true,//开关,是否显示每页大小的下拉框 "bProcessing": true, "bScrollInfinite": false, "sScrollY": "800px",//是否启用垂直滚动条,以及指定滚动区域大小,可设值为:"disabled":"2000px" "bSort": true,//开关是否启用各列具有按列排序的功能 "bSortClasses": true, "bStateSave": false,//开关,是否打开客户端状态记录功能。 //这个数据是记录在cookies中的,打开了这个记录后,即使刷新一次页面, //或重新打开浏览器,之前的状态都是保存下来的- ------当值为true时aoColumnDefs不能隐藏列 "sScrollX": "50%",//是否开启水平滚动,以及指定滚动区域的大小,可设置值"disabled":"2000%" "aaSorting": [[0, "asc"]], "aoColumnDefs": [{ "bVisible": false, "aTargets": [0] }],//隐藏列 "sDom": "<‘H‘if>t<‘F‘if>", "bAutoWidth": false,//自适应宽度 "aaSorting": [[1, "asc"]], "sPaginationType": "full_numbers", "oLanguage": { "sProcessing": "正在加载中......", "sLengthMenu": "每页显示_MENU_条记录", "sZeroRecords": "对不起,查询不到数据", "sEmptyTable": "表中无数据存在!", "sInfo": "当前显示_START_到_END_条,共_TOTAL_条记录", "sInfoFiltered": "数据表中共为_MAX_条记录", "sSearch": "搜索", "oPaginate":{ "sFirst": "首页", "sPrevious": "上一页", "sNext": "下一页", "sLast":"末页" } }//多语言配置 }); }); </script> </head> <body> <table cellpadding="0" cellspacing="0" border="0" class="display" id="datatable1"> <thead> <tr> <th>姓名</th> <th>性别</th> <th>年龄</th> <th>地址</th> </tr> </thead> <tbody> <tr class="old gradeX"> <td> XXX </td> <td> 男 </td> <td class="center"> 12 </td> <td class="center"> 济南 </td> </tr> <tr class="old gradeX"> <td> ZZZ </td> <td> 男 </td> <td class="center"> 11 </td> <td class="center"> 北京 </td> </tr> <tr class="old gradeX"> <td> HHH </td> <td> 男 </td> <td class="center"> 15 </td> <td class="center"> 上海 </td> </tr> </tbody> </table> </body> </html>
标签:
原文地址:http://www.cnblogs.com/mfc-itblog/p/4766787.html