CSS样式(必须)文章来源:https://uudwc.com/A/aYBZR
.layui-table-cell {
line-height: 20px !important;
vertical-align: middle;
height: auto;
overflow: visible;
text-overflow: inherit;
white-space: normal;
}
固定列自适应换行后的高度文章来源地址https://uudwc.com/A/aYBZR
that.tableIns = that.http.table({
id: 'dmmoDataList'
, elem: '#dmmoDataList'
, height: '300px'
, data: data
, page: {curr: 1}//重新从第 1 页开始
, skin: 'rows'
, cols: [[ //表头
{field: '', type: 'numbers', title: '序号', fixed: 'left', align: 'center'}
]]
, done: function (res) {
that.$(".layui-table-main tr").each(function (index, val) {
that.$(that.$(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height(that.$(val).height());
that.$(that.$(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height(that.$(val).height());
});
}
});