The problem is that my perl script passes an array (of 42 elements) to the template and loops through all the elements to generate the calendar. However, I cannot figure out how to get HTML::Template to create a new row after seven data elements prints out.
HTML::Template has an IF statement but it's very limited. I need a way to tell when seven items have been processed so I can print the tags /TR TR to start a new row. I only want seven days worth of stuff per table row.
Anybody know how I can do this?
I've done similar things using HTML::Template, that is put a break in after x items.
What you need is another variable in your array for each element, call it new_row for example.
For the 7th element set new_row to 1, all others should be 0
then you can use:
<tmpl_if name=new_row></tr><tr></tmpl_if>
I think that's correct off the top of my head!