On Tue, May 21, 2002 at 11:53:52AM +0300, Viljo Marrandi wrote:
> Let's say my SQL query outputs following data to me:
[...]
> And with TT I'd like to make a HTML table from this
> that looks like this:
[...]

Have a look at Template::Plugin::Table.  You pass it a list
of data, or an iterator returned by the DBI plugin, and tell it
that you want the data in rows of 3 columns.  Then you simply 
walk over the rows and items in the rows.

   [% USE DBI(dsn,user,pass);
      results = DBI.query('SELECT blah FROM blah');
      USE table(results, cols=3);
      FOREACH row = table.rows;
        FOREACH item = row;
          item.whatever;
        END;
      END;
    %]

A



Reply via email to