From 3c7417617a609cb68d6363caeb9914462a0f8a1d Mon Sep 17 00:00:00 2001 From: git Date: Sun, 4 Jul 2021 11:24:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96table=5Fadapt=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout/adapt/adapt.table.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/wrapper/layout/adapt/adapt.table.js b/src/core/wrapper/layout/adapt/adapt.table.js index 74d3f4a44..0539b7f41 100644 --- a/src/core/wrapper/layout/adapt/adapt.table.js +++ b/src/core/wrapper/layout/adapt/adapt.table.js @@ -40,6 +40,9 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { ((columnSize * 100).toFixed(1) + "%") : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); } + if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { + width = 2; + } if (!this.hasWidget(this._getChildName(i))) { var w = BI._lazyCreateWidget(item); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); @@ -57,7 +60,9 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { // 1、由于直接对td设置最大宽度是在规范中未定义的, 所以要使用类似td:firstChild来迂回实现 // 2、不能给多个td设置最大宽度,这样只会平分宽度 // 3、多百分比宽度就算了 - td.element.css({"max-width": BI.isNumber(o.columnSize[i]) ? (o.columnSize[i] < 1 ? width : width / BI.pixRatio + BI.pixUnit) : width}); + if (columnSize > 0) { + td.element.css({"max-width": columnSize < 1 ? width : width / BI.pixRatio + BI.pixUnit}); + } if (i === 0) { td.element.addClass("first-element"); }