layui的静态表格,表头如何自动换行,而不是显示为...?
layui数据表格的表头换行:
1、修改下表格样式:
<style type="text/css">
.layui-table-cell {
height: auto;
line-height: 28px;
padding: 0 15px;
position: relative;
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
box-sizing: border-box;
}
</style>
2、调整 设置width的值
layui数据表格的在同一个单元格展示两个数据
cols: [[
{field:'title', title: '标题', width: 200
,templet: function(d){
//d.id 第一个参数,d.title 第二个参数
return 'ID:'+ d.id +',标题:<span style="color: #c00;">'+ d.title +'</span>'
}
}
,{field:'id', title:'ID', width:100}
]]