PP_ALIGN.CENTER do nothing
Question:
The below line code do nothing:
row.cells[0].text_frame.paragraphs[0].alignement = PP_ALIGN.CENTER
It also does not throw any error.
Am I doing something wrong there ?
Below is the reproducible example :
for row_idx, row in enumerate(table.rows):
row.cells[0].text_frame.paragraphs[0].alignement = PP_ALIGN.CENTER
The goal of the above code is to center first cell of each row. But for now they keep being aligned on the left.
Answers:
It’s highly likely to be alignment
, not alignement
.
The latter is an attribute with no usefulness.
I have got table cell alignment to work in my md2pptx (https://github.com/MartinPacker/md2pptx)package. (And, no, this is not intended to be an advert for that. Feel free to browse the code.)
The below line code do nothing:
row.cells[0].text_frame.paragraphs[0].alignement = PP_ALIGN.CENTER
It also does not throw any error.
Am I doing something wrong there ?
Below is the reproducible example :
for row_idx, row in enumerate(table.rows):
row.cells[0].text_frame.paragraphs[0].alignement = PP_ALIGN.CENTER
The goal of the above code is to center first cell of each row. But for now they keep being aligned on the left.
It’s highly likely to be alignment
, not alignement
.
The latter is an attribute with no usefulness.
I have got table cell alignment to work in my md2pptx (https://github.com/MartinPacker/md2pptx)package. (And, no, this is not intended to be an advert for that. Feel free to browse the code.)