X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/8e94a506baa66da18cd7389d22bf94ed8581fd85..baf33b39fcddb95d9289abd6b0529f2bffc89687:/HTML/php/Tabla.php?ds=sidebyside diff --git a/HTML/php/Tabla.php b/HTML/php/Tabla.php index ea34ea4..30ab34a 100644 --- a/HTML/php/Tabla.php +++ b/HTML/php/Tabla.php @@ -263,7 +263,8 @@ class Tabla extends HTML_Table { $tmp = $this->_parseAttributes($this->_conf['atributos']['tabla_contenedora']); $tmp['width'] = $this->_attrs['width']; $tabla_externa = new HTML_Table($tmp); - $tabla_externa->setCellContents(0,0,parent::toHtml(),$this->_conf['atributos']['celda_comun']); + $tabla_externa->setCellContents(0, 0, parent::toHtml()); + $tabla_externa->setCellAttributes(0, 0, $this->_conf['atributos']['celda_comun']); $result = $tabla_externa->toHtml(); } else { @@ -346,18 +347,18 @@ class Tabla extends HTML_Table { if (is_string($attrs)) { $attrs = $this->_parseAttributes($attrs); } - $rta = ''; + #$rta = array(); + $rta = $this->_conf['atributos']['celda_comun']; + #$sin_estilo = true; foreach ($attrs as $attr => $val) { $attr = strtolower($attr); switch ($attr) { + // Estilos de celda case 'comun': - $rta .= $this->_conf['atributos']['celda_comun']; - break; case 'cabecera': - $rta .= $this->_conf['atributos']['celda_cabecera']; - break; case 'titulo': - $rta .= $this->_conf['atributos']['celda_titulo']; + #$sin_estilo = false; + $rta = array_merge($rta, $this->_conf['atributos']["celda_$attr"]); break; case 'align': case 'valign': @@ -370,20 +371,24 @@ class Tabla extends HTML_Table { case 'border': case 'cellspacing': case 'cellpadding': - $rta .= "$attr=\"$val\""; + $rta[$attr] = $val; break; case 'spacing': case 'padding': - $rta .= "cell$attr=\"$val\""; + $rta["cell$attr"] = $val; break; case 'nowrap': case 'th': - $rta .= $attr; + $rta[$attr] = ''; break; default: trigger_error("No se permite setear el atributo $attr", E_USER_ERROR); } } + // Si no tiene estilo, agrego estilo comun. + #if ($sin_estilo) { + #$rta = $this->_conf['atributos']['celda_comun']; + #} return $rta; }