mirror of https://github.com/layui/layui
优化 table 多级表头的宽度分配
parent
6cc405f218
commit
76076dbfa3
|
@ -811,15 +811,15 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
||||||
if(that.autoColNums > 0 && patchNums >= -colNums && patchNums <= colNums){
|
if(that.autoColNums > 0 && patchNums >= -colNums && patchNums <= colNums){
|
||||||
var getEndTh = function(th){
|
var getEndTh = function(th){
|
||||||
var field;
|
var field;
|
||||||
th = th || that.layHeader.eq(0).find('thead th:last-child')
|
th = th || that.layHeader.eq(0).find('thead > tr:first-child > th:last-child')
|
||||||
field = th.data('field');
|
field = th.data('field');
|
||||||
if(!field && th.prev()[0]){
|
if(!field && th.prev()[0]){
|
||||||
return getEndTh(th.prev())
|
return getEndTh(th.prev())
|
||||||
}
|
}
|
||||||
return th
|
return th
|
||||||
}
|
};
|
||||||
,th = getEndTh()
|
var th = getEndTh();
|
||||||
,key = th.data('key');
|
var key = th.data('key');
|
||||||
|
|
||||||
that.getCssRule(key, function(item){
|
that.getCssRule(key, function(item){
|
||||||
var width = item.style.width || th.outerWidth();
|
var width = item.style.width || th.outerWidth();
|
||||||
|
|
Loading…
Reference in New Issue