python-docx-template
python-docx-template copied to clipboard
Adding multiple statements to table
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
Choose one solution
total.docx