python - python-docx - 在文档末尾添加一个表格
问题描述
我必须在每个文档的末尾添加一个表格。但是文本永远不会在文档末尾完成。
是否有任何提示如何在文档末尾附加此表?谢谢
txt = ["xxxxxx","yyyyyy","zzzzzz"]
d = Document(os.path.join(path,i))
table = d.add_table(rows=3, cols=1)
for j in range(3):
row = table.rows[j]
row.cells[0].text = txt[j]
d.save(os.path.join(path,i))
解决方案
推荐阅读
- php - Laravel:我可以将自定义方法添加到由 api.php 路由的 API 控制器吗?
- typescript - 该函数的圈复杂度为 11,大于 10 授权
- unity3d - 有没有办法为 HoloLens 2 进行可滚动交互?
- python - 如何编辑此数据框以合并两列字典列表?
- spring-boot - 当有多个带有 SpringIntegration 的 IntegrationFlow 时,如何在特定的 IntegrationFlow 进程上赋予更多优先级
- python - 从 astropy 表中删除行
- numbers - r6rs 语法中用于复数的符号
- python - 格式中的 Django 日志记录错误:KeyError:'classname'
- linux - bash脚本设置父文件夹权限的问题也
- selenium - “Google Colaboratory”没有在 selenium 自动化中加载 Chrome 网络驱动程序?