girdeux
girdeux

Reputation: 720

Python-docx, vertical alignment in cell

Is it possible to vertically align text so it is vertically centered in a table cell?

Upvotes: 4

Views: 7391

Answers (2)

HuLu ViCa
HuLu ViCa

Reputation: 5450

from docx.enum.table import WD_ALIGN_VERTICAL

table = document.add_table(3, 3)
table.cell(0, 0).vertical_alignment = WD_ALIGN_VERTICAL.BOTTOM

https://python-docx.readthedocs.io/en/latest/api/enum/WdCellVerticalAlignment.html

Upvotes: 4

durga kuppusamy
durga kuppusamy

Reputation: 1

 Tablename.Rows(0).Cells(0).VerticalAlignment = VerticalAlignment.Center

Upvotes: 0

Related Questions