-
Notifications
You must be signed in to change notification settings - Fork 1.2k
How to set table cell vertical alignment? #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That feature isn't implemented yet. At the XML level I think you're looking for the vAlign element, that fits in roughly like this, w:tc being table cell: <w:tc>
<w:tcPr>
<w:vAlign ...> There is some context analysis here: You'd need to dig into the schema to work out the specifics of the w:vAlign element or just inspect some Word XML. Then you can get at it with lxml calls from the w:tcPr element. You can get the w:tcPr element with: tc = cell._tc
tcPr = tc.get_or_add_tcPr() If you google on "python-docx OxmlElement" you'll find how to use some of the internal python-docx helper functions to get it done. Here's one to get you started: |
OK, thank you very much. |
@zhaozhiming @scanny
|
|
HI ALL,
I use table merge cell method to merge some cells to a cell, and I want to set the vertical alignment of the merge cell, but I only find the horizontal alignment set method like this:
How could I set the merge cell vertical alignment to center? Thanks.
The text was updated successfully, but these errors were encountered: