您知道如何在表格单元格中旋转文本吗?这是代码示例:shp = slide.shapes.add_table(rows+dop_rows, cols+dop_cols, left, top, width, height)table = shp.tabletable.cell(i,j).text ='something text'但是我在文本框架对象中没有找到任何关于文本旋转或文本方向的信息。我使用最新版本为 0.6.17 的 python pptx 版本
1 回答

隔江千里
TA贡献1906条经验 获得超10个赞
我对解决方法功能做了一些工作并得到了结果。要旋转表格单元格中的文本,我们必须执行以下操作:
the_cell = temp_table.cell(i,j)# get the cell instance object
tcpr = the_cell._tc.get_or_add_tcPr()
tcpr.set('vert','vert270')# setting 'vert' parameter to 'vert270'
prs.save('test.pptx')
添加回答
举报
0/150
提交
取消