elapouya / python-docx-template

Use a docx as a jinja2 template
GNU Lesser General Public License v2.1
1.92k stars 379 forks source link

Insert many tables in loop #551

Open voronind opened 2 weeks ago

voronind commented 2 weeks ago

I want to generate document with many tables which wraps on next pages.

First method. {% for loop.

Screenshot from 2024-07-05 17-09-34

It's bad cause produces blank lines between tables. Different usages of Jinja whitespace control (minus) destroys table or paper format info. Screenshot from 2024-07-05 17-09-18

Second method. {%p for loop

Screenshot from 2024-07-05 17-17-03 It's bad cause it produce one table. All tables merged to one. Thats why we cannot use table bottom margin to split it. Screenshot from 2024-07-05 17-11-31

How can I realize my case?