TEMPLATE:sub table_data { my $self = shift; my @outer_loop; for (my $row = 0; $row <= @{$self->{selection}}; $row++) { my %hash; $hash{table_data_begin_row} = q{<fo:table-row>}; my @inner_loop; for (my $col = 0; $col <= @{$self->{selectionAttr}}; $col++) { my %hash; $hash{table_data} = $self->{selection}[$row][$col]; push @inner_loop, \%hash; } $hash{table_data_close_row} = q{</fo:table-row>}; $hash{table_data} = \@inner_loop; push @outer_loop, \%hash; } $self->{tmpl_obj}->param(table_data_loop => \@outer_loop); }
<fo:table-body> <TMPL_LOOP NAME=table_data_loop> <TMPL_VAR NAME=table_data_begin_loop> <TMPL_LOOP NAME=table_data> <fo:table-cell> <fo:block border-right-width="0.5pt" text-align="center" vertical-al +ign="middle"> <TMPL_VAR NAME=table_data> </fo:block> </fo:table-cell> </TMPL_LOOP> <TMPL_VAR NAME=table_data_close_loop> </TMPL_LOOP> </fo:table-body>
In reply to Help with nested loop in HTML::Template by mhearse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |