iulica / docx-mailmerge

Mail merge for Office Open XML (docx) files without the need for Microsoft Office Word.
MIT License
55 stars 7 forks source link

table rows issue #21

Open bloodyburger opened 3 weeks ago

bloodyburger commented 3 weeks ago

I have a table defined as below, wondering how to populate data into this? image

iulica commented 2 weeks ago

you have an example in the Documentation, in the usage. document.merge_rows("ID", [{"ID": 123, "ProductCode": "abc", ...} , {"ID":124, ... } ])

If you have other fields outside the table that you want replaced, you can also use merge_templates, or merge and give this list of rows as the value of the "ID" attribute. The "ID" attribute can be any attribute inside the table.

Hope this helps