具有docx模板的动态表行

时间:2019-08-20 22:55:05

标签: python python-docx

好,

我正在尝试在.docx文件中动态填充表格。该表如下所示: enter image description here 这里有N个项目(1..N),每个项目都有N行(1..N),因此结构如下:

false

我目前正在使用python-docx-template库,并且关于嵌套表的在线示例很少。谁能指导我正确的方向?

任何帮助将不胜感激。

解决方案:

我在以下位置找到了此嵌套表案例所需的信息: https://github.com/elapouya/python-docx-template/blob/master/tests/templates/subdoc_tpl.docxhttps://github.com/elapouya/python-docx-template/blob/master/tests/templates/subdoc_tpl.docx

,其语法为: https://github.com/elapouya/python-docx-template/blob/master/tests/dynamic_table.py

希望这对像我这样的人有所帮助:)美好的一天!

enter image description here