diff --git a/includes/tsmmonitor.php b/includes/tsmmonitor.php index aaec342..32a3d42 100644 --- a/includes/tsmmonitor.php +++ b/includes/tsmmonitor.php @@ -880,10 +880,12 @@ class TSMMonitor { */ function renderZebraTableRow ($row, $shade , $alarmcol, $color, $cellproperties) { + $isNotEmpty = FALSE; $colorsarray = $this->configarray["colorsarray"]; - $outp = $outp.""; + while(list($keycell, $valcell) = each($row)) { + if (isset($cellproperties) && $cellproperties[$keycell] != "") { $cellproperty = " ".$cellproperties[$keycell]." "; } else { @@ -900,10 +902,15 @@ class TSMMonitor { } else { $outp = $outp."".$valcell.""; } + if ($valcell != "") $isNotEmpty = TRUE; } $outp = $outp."\n"; - return $outp; + if ($isNotEmpty) { + return $outp; + } else { + return ""; + } } diff --git a/index.php b/index.php index a4b5647..c7d44fe 100644 --- a/index.php +++ b/index.php @@ -110,14 +110,11 @@ include_once "includes/page_head.php"; echo "KeyValue"; foreach ($tablearray as $row) { while(list($keycell, $valcell) = each($row)) { - if ($i == 0) { - echo ""; - $i = 1; - } else { - echo ""; - $i = 0; - } - echo "".$keycell."".$valcell.""; + $vertrow = array(); + $vertrow["key"] = $keycell; + $vertrow["value"] = $valcell; + echo $tsmmonitor->renderZebraTableRow($vertrow, $i%2, "", "", ""); + $i++; } }