From 8bb8a8b43c47993bffc1fbb0514efbb71a361ff1 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 30 Oct 2008 04:20:03 +0000 Subject: [PATCH] print_table: allow headings to span multiple columns. --- lib/weblib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/weblib.php b/lib/weblib.php index 0f7d2fb406..eeb0c69c4c 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -4748,6 +4748,7 @@ function print_png($url, $sizex, $sizey, $return, $parameters='alt=""') { *
  • $table->id - id attribute to put on the table. *
  • $table->rowclass[] - classes to add to particular rows. *
  • $table->summary - Description of the contents for screen readers. + *
  • $table->headspan can be used to make a heading span multiple columns. * * @param bool $return whether to return an output string or echo now * @return boolean or $string @@ -4827,13 +4828,18 @@ function print_table($table, $return=false) { if (!isset($align[$key])) { $align[$key] = ''; } + if (isset($table->headspan[$key]) && $table->headspan[$key] > 1) { + $colspan = ' colspan="' . $table->headspan[$key] . '"'; + } else { + $colspan = ''; + } if ($key == $lastkey) { $extraclass = ' lastcol'; } else { $extraclass = ''; } - $output .= ''. $heading .''; + $output .= ''. $heading .''; } $output .= ''."\n"; } -- 2.39.5