Piotr Labudda 8 anni fa
parent
commit
fb321826da
1 ha cambiato i file con 5 aggiunte e 4 eliminazioni
  1. 5 4
      SE/se-lib/UI.php

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

@@ -117,6 +117,7 @@ class UI {
 		$caption = V::get('caption', '', $params);
 		$cellPadding = V::get('cell_padding', 2, $params, 'int');
 		$showLp = (!V::get('disable_lp', false, $params));
+		$cssClassTable = V::get('@class', 'table table-bordered table-hover', $params);
 		$countCols = 1;
 		if (empty($cols) && !empty($rows)) {
 			$firstRow = array();
@@ -147,7 +148,7 @@ class UI {
 		// if (empty($cols)) return;
 		$hiddenCols = V::get('hidden_cols', array(), $params);
 
-		$tableAttrs = [ 'class' => "table table-bordered table-hover" ];
+		$tableAttrs = [ 'class' => $cssClassTable ];
 		$html_id = V::get('__html_id', '', $params);
 		if ($html_id) $tableAttrs['id'] = $html_id;
 		self::startTag('table', $tableAttrs); echo "\n";
@@ -155,10 +156,10 @@ class UI {
 		if (!empty($cols)) {
 			self::startTag('thead', null); echo "\n";
 			self::startTag('tr', null); echo "\n";
-			if ($showLp) { self::tag('th', [ 'style' => "padding:2px" ], "Lp.");	echo "\n"; }
+			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:2px" ], [
+				echo self::h('th', [ 'style' => "padding:{$cellPadding}px" ], [
 					$colName,
 					" " . V::get($colName, '', $help)
 				]);
@@ -172,7 +173,7 @@ class UI {
 		self::startTag('tbody', $tbodyAttrs); echo "\n";
 		if (empty($rows)) {
 			self::startTag('tr'); echo "\n";
-				self::tag('td', [ 'style' => "padding:2px", 'colspan' => $countCols ], V::get('empty_msg', "Brak danych", $params)); echo "\n";
+				self::tag('td', [ 'style' => "padding:{$cellPadding}px", 'colspan' => $countCols ], V::get('empty_msg', "Brak danych", $params)); echo "\n";
 			self::endTag('tr'); echo "\n";
 		} else {
 			$i = 0;