想要合并单元内容,可以试试函数转义的方法
函数转义。自 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 +',标题:<span style="color: #c00;">'+ d.title +'</span>'
6. }
7. }
8. ,{field:'id', title:'ID', width:100}
9. ]]
10. });
下面是我写的部分代码,仅供参考,
HTML代码:
<div class="col-lg-9 pr-4 px-1">
<strong>用户银行账户列表</strong>
<table id="tbBankAccount" layui-filter="tbBankAccount"></table>
</div>
表头参数:
cols: [[ //表头
{ title: &#