diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-05-02 11:48:41 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-05-02 11:48:41 +0100 |
| commit | a0155bb9c522b9b008ad3933ffcb9609b0f698e7 (patch) | |
| tree | d3740b735a409b0a8045fad9dfdefe83b264fb0e /mammoth/documents.py | |
| parent | 85ff4da3812222eaa59b4be434c9118af85ced1b (diff) | |
Read colspan for table cells
Diffstat (limited to 'mammoth/documents.py')
| -rw-r--r-- | mammoth/documents.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mammoth/documents.py b/mammoth/documents.py index d837556..7f17f3e 100644 --- a/mammoth/documents.py +++ b/mammoth/documents.py @@ -48,7 +48,7 @@ class TableRow(HasChildren): @cobble.data class TableCell(HasChildren): - pass + colspan = cobble.field() @cobble.data class LineBreak(Element): @@ -111,7 +111,12 @@ bookmark = Bookmark table = Table table_row = TableRow -table_cell = TableCell +def table_cell(children, colspan=None): + if colspan is None: + colspan = 1 + return TableCell(children=children, colspan=colspan) + + line_break = LineBreak def numbering_level(level_index, is_ordered): |
