aboutsummaryrefslogtreecommitdiff
path: root/mammoth
diff options
context:
space:
mode:
Diffstat (limited to 'mammoth')
-rw-r--r--mammoth/conversion.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mammoth/conversion.py b/mammoth/conversion.py
index a2d1d0d..ce4ee21 100644
--- a/mammoth/conversion.py
+++ b/mammoth/conversion.py
@@ -153,9 +153,13 @@ class _DocumentConverter(documents.ElementVisitor):
def visit_table_cell(self, table_cell):
+ if table_cell.colspan == 1:
+ attributes = {}
+ else:
+ attributes = {"colspan": str(table_cell.colspan)}
nodes = [html.force_write] + self._visit_all(table_cell.children)
return [
- html.element("td", {}, nodes)
+ html.element("td", attributes, nodes)
]