From 29b5a289f6e3378bf5a20d8c15cedddac2248282 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 14 Sep 2018 11:35:24 +0800 Subject: [PATCH] Roo/bootstrap/Table.js --- Roo/bootstrap/Table.js | 51 +++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/Roo/bootstrap/Table.js b/Roo/bootstrap/Table.js index c34f12d9cb..a31368f3a7 100644 --- a/Roo/bootstrap/Table.js +++ b/Roo/bootstrap/Table.js @@ -259,37 +259,25 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, { } // this lot should be simplifed... + var _t = this; + var cp = [ + 'align', + 'bgcolor', + 'border', + 'cellpadding', + 'cellspacing', + 'frame', + 'rules', + 'sortable', + 'summary', + 'width' + ].forEach(function(k) { + if (t[k]) { + cfg[k] = t[k]; + } + }); + - if (this.align) { - cfg.align=this.align; - } - if (this.bgcolor) { - cfg.bgcolor=this.bgcolor; - } - if (this.border) { - cfg.border=this.border; - } - if (this.cellpadding) { - cfg.cellpadding=this.cellpadding; - } - if (this.cellspacing) { - cfg.cellspacing=this.cellspacing; - } - if (this.frame) { - cfg.frame=this.frame; - } - if (this.rules) { - cfg.rules=this.rules; - } - if (this.sortable) { - cfg.sortable=this.sortable; - } - if (this.summary) { - cfg.summary=this.summary; - } - if (this.width) { - cfg.width=this.width; - } if (this.layout) { cfg.style = (typeof(cfg.style) == 'undefined') ? ('table-layout:' + this.layout + ';') : (cfg.style + ('table-layout:' + this.layout + ';')); } @@ -939,6 +927,9 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, { if(typeof(config.align) != 'undefined' && config.align.length){ td.style += ' text-align:' + config.align + ';'; } + if(typeof(config.valign) != 'undefined' && config.valign.length){ + td.style += ' vertical-align:' + config.valign + ';'; + } if(typeof(config.width) != 'undefined'){ td.style += ' width:' + config.width + 'px;'; -- 2.39.2