python-docx center table content
问题 I've just started using python-docx and I'm trying to center the contents of my table. I have: table = document.add_table(rows=1, cols=1) tableHeader = table.rows[0].cells tableHeader[0].text = 'test' row_cells = table.add_row().cells row_cells[0].text = 'example' table.style = 'MediumGrid3' which outputs a table with the header test and the text example . I thought table.alignment = 1 would work, but it does nothing. So how do I align all the text to the center? 回答1: The setting you're