I just began using HTML::Template and am trying to create an HTML table. In all the examples I've read so far (POD, online), the tables are very basic -- one set of data per row and column, vis:
+--------+--------+ | Name | Phone | +--------+--------+ | Name2 | Phone2 | +--------+--------+ ...
I would like to do the following:
+-------+-------+-------+-------+ | Name | Name1 | Name2 | Name3 | | Phone | Phone1| Phone2| Phone3| +-------+-------+-------+-------+ | Name4 | Name5 | Name6 | Name7 | | Phone4| Phone5| Phone6| Phone7| +-------+-------+-------+-------+
Does this make sense?
My code does not work:
<table border="0"> <TMPL_LOOP NAME="PHONE_LOOP"> <tr> <td> <TMPL_VAR NAME="NAME"> <br> <TMPL_VAR NAME="PHONE"> </td> <td> <TMPL_VAR NAME="NAME"> <br> <TMPL_VAR NAME="PHONE"> </td><td> <TMPL_VAR NAME="NAME"> <br> <TMPL_VAR NAME="PHONE"> </td><td> <TMPL_VAR NAME="NAME"> <br> <TMPL_VAR NAME="PHONE"> </td> </tr> </TMPL_LOOP> </table>
This, of course, just repeats the same pair of variables four times in the row, instead of getting the first four sets. I know I could create the rows in the Perl script, but the idea of the HTML::Template would be that I could tweak the template to adjust how many columns.
Any help, pointers, docs would be very helpful. Thanks
In reply to Column Count w/ HTML::Template by dejoha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |