From 9ba8b47bc80af6973d79d976fd2efda386987bbb Mon Sep 17 00:00:00 2001 From: lijiangt Date: Sun, 9 Dec 2018 12:46:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=A2=9E=E5=8A=A0=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E5=AE=BD=E5=BA=A6=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/dwz.stable.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/js/dwz.stable.js b/js/dwz.stable.js index 26c7d39..090105d 100644 --- a/js/dwz.stable.js +++ b/js/dwz.stable.js @@ -7,6 +7,23 @@ return this.each(function(){ var $table = $(this), nowrapTD = $table.attr("nowrapTD"); var tlength = $table.width(); + var assign = false; + if($table.attr("assign")=="true"){ + assign = true; + var th_w_all=0; + var columnCount = 0; + $table.children("thead").children("tr").find("th").each(function(i,n){ + columnCount++; + if($(this).attr("width")!=""){ + th_w_all+=parseInt($(this).attr("width")); + }else{ + th_w_all+=160; + } + }); + if(th_w_all>0){ + tlength=th_w_all+columnCount+1; + } + } var aStyles = []; var $tc = $table.parent().addClass("j-resizeGrid"); // table parent container var layoutH = $(this).attr("layoutH"); @@ -16,6 +33,9 @@ for(var i = 0, l = oldThs.size(); i < l; i++) { var $th = $(oldThs[i]); var style = [], width = $th.innerWidth() - (100 * $th.innerWidth() / tlength)-2; + if(assign){ + width = parseInt($th.attr("width")); + } style[0] = parseInt(width); style[1] = $th.attr("align"); aStyles[aStyles.length] = style; -- Gitee