diff options
Diffstat (limited to 'mammoth/docx')
| -rw-r--r-- | mammoth/docx/body_xml.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/mammoth/docx/body_xml.py b/mammoth/docx/body_xml.py index f3166f5..a44169a 100644 --- a/mammoth/docx/body_xml.py +++ b/mammoth/docx/body_xml.py @@ -164,8 +164,21 @@ def _create_reader(numbering, content_types, relationships, styles, docx_file, f def table_cell(element): + gridspan = element \ + .find_child_or_null("w:tcPr") \ + .find_child_or_null("w:gridSpan") \ + .attributes.get("w:val") + + if gridspan is None: + colspan = 1 + else: + colspan = int(gridspan) + return _read_xml_elements(element.children) \ - .map(documents.table_cell) + .map(lambda children: documents.table_cell( + children=children, + colspan=colspan + )) def read_child_elements(element): |
