From 21988c8e20e5b4c00a52927079d2c195baba899c Mon Sep 17 00:00:00 2001 From: tjhunt Date: Fri, 6 Jul 2007 11:29:25 +0000 Subject: [PATCH] Small improvement to print_table. Lets you apply a class attribute to particular table rows. --- lib/weblib.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 6ca90a4e73..bd45ca10dd 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3879,7 +3879,8 @@ function print_png($url, $sizex, $sizey, $return, $parameters='alt=""') { * Print a nicely formatted table. * * @param array $table is an object with several properties. - * $table->head - An array of heading names. + * * @param bool $return whether to return an output string or echo now * @return boolean or $string @@ -3974,7 +3978,10 @@ function print_table($table, $return=false) { $oddeven = 1; foreach ($table->data as $key => $row) { $oddeven = $oddeven ? 0 : 1; - $output .= ''."\n"; + if (!isset($table->rowclass[$key])) { + $table->rowclass[$key] = ''; + } + $output .= ''."\n"; if ($row == 'hr' and $countcols) { $output .= '
'; } else { /// it's a normal row of data -- 2.39.5