python-docx-template icon indicating copy to clipboard operation
python-docx-template copied to clipboard

Adding multiple statements to table

Open Martmists-GH opened this issue 1 year ago • 1 comments

Describe your problem

index x y z
{% for entry in entries %} {% if entry.index != "total" %}
{{ entry.index }} {{ entry.x }} {{ entry.y }} {{ entry.z }}
{% endif %} {% endfor %} {% set entry = entries[-1] %}
Total {{ entry.x }} {{ entry.y }} {{ entry.z }}

More details about your problem

Where do I put the tr in this case? No matter what I try, it always says I'm closing an if when I should be closing a for, or the other way around.

Provide a test case

See above

Screenshots

N/A

Martmists-GH avatar Oct 09 '23 10:10 Martmists-GH

Choose one solution total.docx total gen

SergeyZaykov avatar Nov 18 '23 22:11 SergeyZaykov