mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-18 21:03:32 +02:00
DOCX Output: vertical alignment for table cells
This commit is contained in:
parent
e59e1060ae
commit
732e92fb3f
1 changed files with 4 additions and 0 deletions
|
|
@ -94,6 +94,7 @@ def __init__(self, row, html_tag, tag_style):
|
|||
self.col_span = max(0, int(html_tag.get('colspan', 1)))
|
||||
except Exception:
|
||||
self.col_span = 1
|
||||
self.valign = {'top':'top', 'bottom':'bottom', 'middle':'center'}.get(tag_style._get('vertical-align'))
|
||||
self.items = []
|
||||
self.width = convert_width(tag_style)
|
||||
self.background_color = None if tag_style is None else convert_color(tag_style.backgroundColor)
|
||||
|
|
@ -134,6 +135,9 @@ def serialize(self, parent):
|
|||
if len(m) > 0:
|
||||
tcPr.append(m)
|
||||
|
||||
if self.valign is not None:
|
||||
makeelement(tcPr, 'w:vAlign', w_val=self.valign)
|
||||
|
||||
if self.row_span > 1:
|
||||
makeelement(tcPr, 'w:vMerge', w_val='restart')
|
||||
if self.col_span > 1:
|
||||
|
|
|
|||
Loading…
Reference in a new issue