summaryrefslogtreecommitdiff
path: root/mammoth/conversion.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-05-12 22:32:49 +0100
committerMichael Williamson <mike@zwobble.org>2016-05-12 22:32:49 +0100
commit220496246ee4648e7d4067bfebd9db44d5e2d151 (patch)
tree135e0eb743cf8a5e0f243003ccbc2ccf60f09e27 /mammoth/conversion.py
parentbd222b2b8cc8d2e95edfbe83a3ef41a2d44be747 (diff)
Write out rowspan when converting to HTML
Diffstat (limited to 'mammoth/conversion.py')
-rw-r--r--mammoth/conversion.py9
1 files changed, 5 insertions, 4 deletions
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)