Closed stefanomattia closed 1 year ago
The {% for / endfor
must be inside the table : have a look to tests/
directory in source code to have exemples.
Thank you for the quick response.
Putting the for and enfor inside the table (on a merged row) kind of works (some spurious cells at the end), but I get one table with the two requirements concatenated (see screenshot). However, I would like to have two separate tables, hence I put the for and endfor outside the table template, is that possible?
The template I used is:
Sorry, I haven't seen that point, so what you did was almost good : put for loop
outside the table but use {%p
instead of {%tr
Awesome, this works, thanks a lot!
Describe the bug
Unable to open generated word file
To Reproduce
I am using the following code:
The gsrd_template.docx is a simple word document with the following content:
Expected behavior
I would expect the generated word document to contain two tables for each of the two defined requirements in the context dictionary. However, even if there are no errors during the code execution, the generated word document can't be opened (see screenshot).![Screenshot 2023-04-19 at 17 56 34](https://user-images.githubusercontent.com/16152387/233132570-5955f64e-7f0d-44f9-b6ed-46c112426003.png)
Additional context
I am using Python 3.9.31, docxtpl 0.11.5 (installed via conda), python-docx 0.8.11, Word for Mac 16.72