[cgiapp] Variable Number of Column in a Table

Stephen Carville stephen.carville at gmail.com
Thu May 15 12:03:54 EDT 2008


Is there any way to have a template where the number of columns is
determined at run time?  I know how to use TMPL_LOOP but that only
lets me vary the number of rows.

What I'm doing is creating a template for SQL reports so I want a
structure like:

  <TMPL_LOOP NAME=SQL_OUTPUT>
    <TMPL_IF NAME="__first__">
      Headers go here
    </TMPL_IF>

    <TMPL_IF NAME="__odd__">
      Row of data in odd row color set
    </TMPL_IF>

    <TMPL_UNLESS NAME="__odd__">
      Row of data in even row color set
    </TMPL_UNLESS>
 </TMPL_LOOP>


-- 
Stephen Carville


More information about the cgiapp mailing list