Categories > OpenTBS with DOCX >

Dynamic Table Approach

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: John Richards
Date: 2014-09-13
Time: 23:31

Dynamic Table Approach

I am trying to loop through a number of records in PHP and build a dynamic table in the docx file.

Each record has the same number of parameters (columns in the table), but I do not know how many records (rows) there are in advance.

Is the best approach to build my template with plenty of rows and then delete them onload? Or am I missing something simpler?

Not looking for people to write this for me, I just don't want to miss a trick. Thanks! (I did a quick search and most of the similar questions are a lot more specific.)
By: Skrol29
Date: 2014-09-14
Time: 20:29

Re: Dynamic Table Approach

Hi John,

It seems you are missing a basic TBS feature.
MergeBlock() do actually repeat a block (a row in a table for example) as many time have you have records.

You can have a look at the examples provided with the OpenTBS package. They are also available in line.