1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-17 20:11:46 +02:00

allow custom th classes

this allows customization of th elements and when using relative column sizing classes it also allows to avoid repeating those classes in every tbody row.
This commit is contained in:
maks feltrin
2016-11-01 02:32:08 +01:00
committed by GitHub
parent b50b1f9a28
commit 83d4788764

View File

@@ -135,8 +135,11 @@ class MarkupAdminDataTable extends ModuleJS {
if(count($this->headerRow)) {
$out .= "\n\t<thead>\n\t<tr>";
foreach($this->headerRow as $th) {
$th = $this->encode($th);
$out .= "\n\t\t<th>$th</th>";
$class = '';
if(is_array($th)) list($th, $class) = $th;
$th = $this->encode($th);
if($class) $class = " class='" . $this->encode($class) . "'";
$out .= "\n\t\t<th$class>$th</th>";
$maxCols++;
}
$out .= "\n\t</tr>\n\t</thead>";