废话不多说,直接上代码吧!如下所示:

table.render({
   elem: '#data_grid'
   //,width: 900
   //,height: 274
   ,cols: [[ //标题栏
    {field: 'id', title: 'ID', width: 80, sort: true}
    ,{field: 'username', title:'用户名',width: 100} //空列
    ,{field: 'password', title: '密码', width: 120}
    ,{field: 'gender', title: '性别', width: 150}
    ,{field: 'nichen', title: '昵称', width: 150}
    ,{field: 'birthday', title: '出生年月', width: 120}
    ,{fixed: 'right', width: 215,align:'center', toolbar: '#barDemo'}
   ]]
   ,url:url
   ,skin: 'row' //表格风格
   ,even: true
   ,page: true //是否显示分页
   ,limits: [3,5,10]
   ,limit: 5 //每页默认显示的数量
   ,done:function(res){
    userPage.data = res.data;
   }
   //,loading: false //请求数据时,是否显示loading
  });

主要是:limits 和 limit 的设置

以上这篇layui数据表格自定义每页条数limit设置就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持华域联盟。

您可能感兴趣的文章:

声明:本站(华域联盟www.cnhackhy.com)所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。