From 220496246ee4648e7d4067bfebd9db44d5e2d151 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 12 May 2016 22:32:49 +0100 Subject: Write out rowspan when converting to HTML --- mammoth/conversion.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mammoth/conversion.py') diff --git a/mammoth/conversion.py b/mammoth/conversion.py index ce4ee21..e05cccc 100644 --- a/mammoth/conversion.py +++ b/mammoth/conversion.py @@ -153,10 +153,11 @@ class _DocumentConverter(documents.ElementVisitor): def visit_table_cell(self, table_cell): - if table_cell.colspan == 1: - attributes = {} - else: - attributes = {"colspan": str(table_cell.colspan)} + attributes = {} + if table_cell.colspan != 1: + attributes["colspan"] = str(table_cell.colspan) + if table_cell.rowspan != 1: + attributes["rowspan"] = str(table_cell.rowspan) nodes = [html.force_write] + self._visit_all(table_cell.children) return [ html.element("td", attributes, nodes) -- cgit v1.2.3