diff --git a/lib/weblib.php b/lib/weblib.php
index 0f7d2fb4061..eeb0c69c4c4 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 .= '';
+ $output .= '';
}
$output .= ''."\n";
}