Hi!
I have this cod which creates 3 tables on the same page:
#foreach($j in [0…2])
(% id=“tableid” class=“doOddEven filterable grid sortable” %)
(% class=“sortHeader” %)|=Student Name |= Math Mark|= Biology Mark|=Average #foreach($i in [0…5])
| | | | #end #end
How can I modify it such that it will create a new page for each table? (At one iteration the written code will create a new page with a single table in the main page, “PageWithTables”)
The structure to be something like this:
That code creates my pages but doesn’t create a table on each page. It creates all tables on the same page which contains the code.
How can I rezolve that?
Do you want to duplicate the Velocity code on each page you create? I doubt you want that because it makes the code hard to maintain. For instance, if later you want to add a new column to your table then you need to update all the pages you have previously created. The most trivial and natural solution in your case is to use an include:
Put the Velocity code that generates the table in a separate page, e.g. TabelNotare.TableGenerator