mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Small fix to avoid warnings on empty tables
This commit is contained in:
parent
e2b7251de9
commit
a1f8ff87c7
@ -1091,21 +1091,23 @@ function print_table($table) {
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
foreach ($table->data as $row) {
|
||||
echo "<tr valign=\"top\">";
|
||||
foreach ($row as $key => $item) {
|
||||
if (!isset($size[$key])) {
|
||||
$size[$key] = "";
|
||||
}
|
||||
if (!isset($align[$key])) {
|
||||
$align[$key] = "";
|
||||
}
|
||||
if (!isset($wrap[$key])) {
|
||||
$wrap[$key] = "";
|
||||
}
|
||||
echo "<td ".$align[$key].$size[$key].$wrap[$key]." class=\"generaltablecell\">$item</td>";
|
||||
if (!empty($table->data)) {
|
||||
foreach ($table->data as $row) {
|
||||
echo "<tr valign=\"top\">";
|
||||
foreach ($row as $key => $item) {
|
||||
if (!isset($size[$key])) {
|
||||
$size[$key] = "";
|
||||
}
|
||||
if (!isset($align[$key])) {
|
||||
$align[$key] = "";
|
||||
}
|
||||
if (!isset($wrap[$key])) {
|
||||
$wrap[$key] = "";
|
||||
}
|
||||
echo "<td ".$align[$key].$size[$key].$wrap[$key]." class=\"generaltablecell\">$item</td>";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
print_simple_box_end();
|
||||
|
Loading…
x
Reference in New Issue
Block a user