From ae44bf4dc76dcc686907d99c8ff208bf952b9ff6 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Thu, 04 Oct 2012 05:46:54 -0400
Subject: [PATCH] Consider colspan attributes when adding table cells/rows

---
 program/include/html.php |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/program/include/html.php b/program/include/html.php
index 9487942..2349852 100644
--- a/program/include/html.php
+++ b/program/include/html.php
@@ -681,9 +681,9 @@
         $cell->content = $cont;
 
         $this->rows[$this->rowindex]->cells[$this->colindex] = $cell;
-        $this->colindex++;
+        $this->colindex += max(1, intval($attr['colspan']));
 
-        if ($this->attrib['cols'] && $this->colindex == $this->attrib['cols']) {
+        if ($this->attrib['cols'] && $this->colindex >= $this->attrib['cols']) {
             $this->add_row();
         }
     }

--
Gitblit v1.9.1