Bouke / docx-mailmerge

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

Can I create a variable number of tables #68

Open revelutions opened 5 years ago

revelutions commented 5 years ago

Expected Behavior

Is there any way to loop through and create multiple tables>

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Context

Here is what I need: Let's say I have customers who have different products. I create tables for each product.

For Customer1, I need 4 products/tables. For Customer2, I need 7 products/tables

I need a structure like this in the docx:

For number of products: Anchor: t1.SKU

t1.SKU t1.Cost t1.Inventory

Anchor: t2.SKU

t2.SKU t2.Cost t2.Inventory

Anchor: t3.SKU . . and so on

Your Environment