aboutsummaryrefslogtreecommitdiff
path: root/mammoth/documents.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-05-12 22:31:20 +0100
committerMichael Williamson <mike@zwobble.org>2016-05-12 22:31:20 +0100
commitbd222b2b8cc8d2e95edfbe83a3ef41a2d44be747 (patch)
treebaa50c0e875ef560d62ecf6a9432efab31f05fd4 /mammoth/documents.py
parent009d8ecdba61cc6d459d3ef87baa1d2cd3095035 (diff)
Add reading of rowspan
Diffstat (limited to 'mammoth/documents.py')
-rw-r--r--mammoth/documents.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/mammoth/documents.py b/mammoth/documents.py
index 7f17f3e..36e3458 100644
--- a/mammoth/documents.py
+++ b/mammoth/documents.py
@@ -49,6 +49,7 @@ class TableRow(HasChildren):
@cobble.data
class TableCell(HasChildren):
colspan = cobble.field()
+ rowspan = cobble.field()
@cobble.data
class LineBreak(Element):
@@ -111,10 +112,12 @@ bookmark = Bookmark
table = Table
table_row = TableRow
-def table_cell(children, colspan=None):
+def table_cell(children, colspan=None, rowspan=None):
if colspan is None:
colspan = 1
- return TableCell(children=children, colspan=colspan)
+ if rowspan is None:
+ rowspan = 1
+ return TableCell(children=children, colspan=colspan, rowspan=rowspan)
line_break = LineBreak