I'm using openTBS to populate tables in a word document. Works great for adding rows to tables with a known amount of columns, however I want to be able to populate a table with an unknown number of rows and columns. Is there a way to achieve this? Thanks.
Is there a way to dynamically add columns to a table in a Word document using openTBS?
1.3k views Asked by Matt At
2
There are 2 answers
1
On
You can add columns following the same tip of Dynamic Columns for HTML tables. But you will not be able to manage the size of columns after the point of insertion. It can be without problem if you add columns at the very right of the table thus size will be automatically applied.
I had a similar requirement in the project I'm working on, and as far as I can find, the blunt answer is 'no'.
One option is to include all columns, and delete those that aren't required. From my experimentation however, I seem to remember (you may wish to double check) that it doesn't resize columns after you've deleted, which for my purposes, meant this wasn't an option.
I ended up creating around 10 different tables in my template, and merging into a different table depending on the data from my php.