diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 4abba59cdb4..edc17c1652c 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -183,21 +183,31 @@ function print_user_picture($userid, $courseid, $picture, $large=false, $returns function print_table($table) { // Prints a nicely formatted table. -// $table is an object with three properties. +// $table is an object with several properties. // $table->head is an array of heading names. // $table->align is an array of column alignments +// $table->size is an array of column sizes // $table->data[] is an array of arrays containing the data. // $table->width is an percentage of the page - if ($table->align) { + if (isset($table->align)) { foreach ($table->align as $key => $aa) { if ($aa) { - $align[$key] = "ALIGN=\"$aa\""; + $align[$key] = " ALIGN=\"$aa\""; } else { $align[$key] = ""; } } } + if (isset($table->size)) { + foreach ($table->size as $key => $ss) { + if ($ss) { + $size[$key] = " WIDTH=\"$ss\""; + } else { + $size[$key] = ""; + } + } + } if (!$table->width) { $table->width = "80%"; @@ -209,7 +219,7 @@ function print_table($table) { if ($table->head) { echo "