Piotr Labudda 5 роки тому
батько
коміт
e82ea7e2c9
1 змінених файлів з 5 додано та 2 видалено
  1. 5 2
      SE/se-lib/UI.php

+ 5 - 2
SE/se-lib/UI.php

@@ -187,7 +187,7 @@ class UI {
 		// if (empty($cols)) return;
 		$hiddenCols = V::get('hidden_cols', array(), $params);
 
-		$tableAttrs = [ 'class' => $cssClassTable ];
+		$tableAttrs = [ 'class' => $cssClassTable, 'style' => V::get('style', '', $params) ];
 		$html_id = V::get('__html_id', '', $params);
 		if ($html_id) $tableAttrs['id'] = $html_id;
 		self::startTag('table', $tableAttrs); echo "\n";
@@ -198,7 +198,10 @@ class UI {
 			if ($showLp) { self::tag('th', [ 'style' => "padding:{$cellPadding}px" ], "Lp.");	echo "\n"; }
 			foreach ($cols as $colName) {
 				if (in_array($colName, $hiddenCols)) continue;
-				echo self::h('th', [ 'style' => "padding:{$cellPadding}px" ], [
+				$attrs = [ 'style' => "padding:{$cellPadding}px" ];
+				if (!empty($params["@class[{$colName}]"])) $attrs['class'] = $params["@class[{$colName}]"];
+				if (!empty($params["@style[{$colName}]"])) $attrs['style'] .= "; " . $params["@style[{$colName}]"];
+				echo self::h('th', $attrs, [
 					$label[$colName],
 					" " . V::get($colName, '', $help)
 				]);