diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 337452af0b4..7ff8d6fb5d3 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -1447,9 +1447,10 @@ class html_writer { if (!($row instanceof html_table_row)) { $newrow = new html_table_row(); - foreach ($row as $item) { - $cell = new html_table_cell(); - $cell->text = $item; + foreach ($row as $cell) { + if (!($cell instanceof html_table_cell)) { + $cell = new html_table_cell($cell); + } $newrow->cells[] = $cell; } $row = $newrow;