easy-template-x
easy-template-x copied to clipboard
Is it possible to add column in the table dynamically ?
Unfortunately no, this is not currently supported.
For future reference if you, or anyone else, want to implement this (and even better, send a PR) this is a good place to start:
- The existing "loop strategy" that creates table rows dynamically - https://github.com/alonrbar/easy-template-x/blob/master/src/plugins/loop/strategy/loopTableStrategy.ts
- Word table XML structure overview - http://officeopenxml.com/WPtable.php
@DVGY could you please provide a sample docx and describe the way you want it to be?
@hydra1983 Just jumping in here sorry, but adding to this topic- we are currently using docx-templates & the only real issue we have is the lack of dynamic columns. i.e taking the same iteration as for rows, but, generating columns based on array length (fixed number of rows, in our case).
I am not sure I understand the use case completely, but if there are a limited number of schemas, you can define separate tables and have them in different tag names. Only output the correct one. Works for my use case. Again, may not help but it is an idea