mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
DOCX Output: vertical alignment for table cells
This commit is contained in:
parent
e59e1060ae
commit
732e92fb3f
@ -94,6 +94,7 @@ class Cell(object):
|
|||||||
self.col_span = max(0, int(html_tag.get('colspan', 1)))
|
self.col_span = max(0, int(html_tag.get('colspan', 1)))
|
||||||
except Exception:
|
except Exception:
|
||||||
self.col_span = 1
|
self.col_span = 1
|
||||||
|
self.valign = {'top':'top', 'bottom':'bottom', 'middle':'center'}.get(tag_style._get('vertical-align'))
|
||||||
self.items = []
|
self.items = []
|
||||||
self.width = convert_width(tag_style)
|
self.width = convert_width(tag_style)
|
||||||
self.background_color = None if tag_style is None else convert_color(tag_style.backgroundColor)
|
self.background_color = None if tag_style is None else convert_color(tag_style.backgroundColor)
|
||||||
@ -134,6 +135,9 @@ class Cell(object):
|
|||||||
if len(m) > 0:
|
if len(m) > 0:
|
||||||
tcPr.append(m)
|
tcPr.append(m)
|
||||||
|
|
||||||
|
if self.valign is not None:
|
||||||
|
makeelement(tcPr, 'w:vAlign', w_val=self.valign)
|
||||||
|
|
||||||
if self.row_span > 1:
|
if self.row_span > 1:
|
||||||
makeelement(tcPr, 'w:vMerge', w_val='restart')
|
makeelement(tcPr, 'w:vMerge', w_val='restart')
|
||||||
if self.col_span > 1:
|
if self.col_span > 1:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user