Beginner wrote:
[SNIP]
> <table>
>     [% USE table(src, rows=3, pad=0) %]
>     [%  FOREACH col = table.cols %]
>      <tr>
>         [% FOREACH item = col %]
>             <td><img src="[% item.img %]"><br>[% item.name %]</td>
>          [% END %]
>       </tr>
>     [% END %]
> </table>
> 
> src is a reference to an array of hashes.
> 
> My problem is that under each row created by item, I want another row 
> with [% item.name %]. In the example above I am using a <br> tag to 
> force the name under the img src. So I am try to generate HTML source 
> that looks like:  
> 
> <tr>
>     <td><img src="/thumbs/1.jpg"></td>
>     <td><img src="/thumbs/2.jpg"></td>
>     <td><img src="/thumbs/3.jpg"></td>
> </tr>
> <tr>
>     <td>name1</td>
>     <td>name2</td>
>     <td>name3</td>
> </tr>

Does this not work for you?

<table>
    [% USE table(src, rows=3, pad=0) %]
    [%  FOREACH col = table.cols %]
     <tr>
        [% FOREACH item = col %]
            <td><img src="[% item.img %]"></td>
         [% END %]
      </tr>
     <tr>
        [% FOREACH item = col %]
            <td>[% item.name %]</td>
         [% END %]
      </tr>
    [% END %]
</table>

-- Josh

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to