use*_*390 5 python docx pandas python-docx
我使用了这段代码:
# 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
Run Code Online (Sandbox Code Playgroud)
哪里df有一些pandas DataFrame。但列不能自动调整。
| 归档时间: |
|
| 查看次数: |
5522 次 |
| 最近记录: |