diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 024d1091bd2..5b08da610b7 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -1562,7 +1562,11 @@ class html_writer { foreach ($table->data as $key => $row) { if (($row === 'hr') && ($countcols)) { - $output .= html_writer::tag('td', html_writer::tag('div', '', array('class' => 'tabledivider')), array('colspan' => $countcols)); + $output .= html_writer::start_tag('tr'); + $output .= html_writer::start_tag('td', array('colspan' => $countcols)); + $output .= html_writer::tag('div', '', array('class' => 'tabledivider')); + $output .= html_writer::end_tag('td'); + $output .= html_writer::end_tag('tr') . "\n"; } else { // Convert array rows to html_table_rows and cell strings to html_table_cell objects if (!($row instanceof html_table_row)) { @@ -1636,8 +1640,8 @@ class html_writer { } $output .= html_writer::tag($tagtype, $cell->text, $tdattributes) . "\n"; } + $output .= html_writer::end_tag('tr') . "\n"; } - $output .= html_writer::end_tag('tr') . "\n"; } $output .= html_writer::end_tag('tbody') . "\n"; }