我用了这个代码:
# open a document
doc = docx.Document()
# add a table to the end and create a reference variable
# extra row is so we can add the header row
t = doc.add_table(df.shape[0]+1, df.shape[1])
t.allow_autofit = True
t.style = 'TableGrid'
t.alignment=WD_TABLE_ALIGNMENT.CENTER
其中df
是一些pandas
DataFrame
。但这些柱子不是自动装配的。在
目前没有回答
相关问题 更多 >
编程相关推荐