diff --git a/program/lib/Roundcube/html.php b/program/lib/Roundcube/html.php
index c7fb3f9e2..4f282df4b 100644
--- a/program/lib/Roundcube/html.php
+++ b/program/lib/Roundcube/html.php
@@ -776,6 +776,10 @@ class html_table extends html
$cell->attrib = $attr;
$cell->content = $cont;
+ if (!isset($this->rows[$this->rowindex])) {
+ $this->rows[$this->rowindex] = new stdClass;
+ }
+
$this->rows[$this->rowindex]->cells[$this->colindex] = $cell;
$this->colindex += max(1, intval($attr['colspan']));