对layui不熟悉,然后找了个大牛帮吗处理的 留个记录

 

页面添加如下样式:

<style type="text/css">
.layui-table-cell {
height: auto;
}
</style>

 

字段渲染代码如下:

cols: [[
{type: 'checkbox'},
{field: 'username', align: 'center', sort: true, title: '账号'},
{field: 'nickName', align: 'center', sort: true, title: '用户名'},
{field: 'phone', align: 'center', sort: true, title: '手机号'},
{field: 'sex', align: 'center', sort: true, title: '性别'},
{field: 'createTime', sort: true, templet: function (d) {
var returnHtml = '';
returnHtml += 'time:' + d.createTime + '<br>';
returnHtml += 'time1:' + d.nickName + '<br>';
returnHtml += 'time2:' + d.username ;
return returnHtml
}, title: '创建时间'
},
{field: 'state', align: 'center', sort: true, templet: '#tplStateTbAdv', title: '状态'},
{align: 'center', toolbar: '#tableBarTbAdv', title: '操作', minWidth: 150}
]]
});

 

这个align 是控制字段内容位置的

去掉 默认就是左对齐

center是居中,right就是右

 

相关文章:

  • 2021-06-24
  • 2021-11-25
  • 2022-01-17
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-24
  • 2022-12-23
  • 2022-12-23
  • 2022-02-19
  • 2021-06-02
  • 2021-12-07
  • 2022-12-23
相关资源
相似解决方案