diff options
Diffstat (limited to 'mammoth')
| -rw-r--r-- | mammoth/conversion.py | 9 |
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) |
