2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > layui table 表头合并_layui table合并单元格

layui table 表头合并_layui table合并单元格

时间:2018-08-03 00:56:03

相关推荐

layui table 表头合并_layui table合并单元格

想要合并单元内容,可以试试函数转义的方法

函数转义。自 layui 2.2.5 开始,templet 开始支持函数形式,函数返回一个参数 d,包含接口返回的所有字段和数据。如下所示: Code layui.code 1.table.render({ 2. cols: [[ 3. {field:'title', title: '文章标题', width: 200 4. ,templet: function(d){ 5. return 'ID:'+ d.id +',标题:'+ d.title +'' 6. } 7. } 8. ,{field:'id', title:'ID', width:100} 9. ]] 10.});

下面是我写的部分代码,仅供参考,

HTML代码:

用户银行账户列表

表头参数: cols: [[ //表头 { title: '序号', type: 'numbers' },//序号列,title设定标题名称 { field: 'BankAccountID', title: 'BankAccountID', hide: true }, { field: 'UserName', title: '用户名' ,align: 'center'}, { field: 'RealName', title: '真实姓名', align: 'center' }, { field: 'BankName', title: '所属银行', align: 'center' }, { field: 'telephone', title: '所在地', align: 'center' , templet: function (d) { return d.ProvinceName + '' + d.CityName + ''//省份和城市合并 } }, { field: 'OpeningBranchName', title: '支行', align: 'center' }, { field: 'BankAccount', title: '提现账号', align: 'center' }, { title: '操作', templet: setOperate, width: 100, align: 'center', fixed: 'right' }//width: 160 指定宽度,align 指定对其方式 ]],

效果:把省份和城市合并

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。