From 4ec9ac08fdb766147773f7fe32e939798b118725 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 25 Aug 2021 11:17:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout/adapt/adapt.table.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/wrapper/layout/adapt/adapt.table.js b/src/core/wrapper/layout/adapt/adapt.table.js index dcec1b19a..daed0c33d 100644 --- a/src/core/wrapper/layout/adapt/adapt.table.js +++ b/src/core/wrapper/layout/adapt/adapt.table.js @@ -58,11 +58,6 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { if (!this.hasWidget(this._getChildName(i))) { var w = BI._lazyCreateWidget(item); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); - if (o.verticalAlign === BI.VerticalAlign.Stretch) { - var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), - bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); - w.element.css("height", "calc(100% - " + ((top + bottom) / BI.pixRatio + BI.pixUnit) + ")"); - } td = BI._lazyCreateWidget({ type: "bi.default", width: width, @@ -73,6 +68,11 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { td = this.getWidgetByName(this._getChildName(i)); td.element.width(width); } + if (o.verticalAlign === BI.VerticalAlign.Stretch) { + var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), + bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); + w.element.css("height", "calc(100% - " + ((top + bottom) / BI.pixRatio + BI.pixUnit) + ")"); + } // 对于表现为td的元素设置最大宽度,有几点需要注意 // 1、由于直接对td设置最大宽度是在规范中未定义的, 所以要使用类似td:firstChild来迂回实现 // 2、不能给多个td设置最大宽度,这样只会平分宽度