On Tue, Dec 04, 2001 at 04:11:22PM +0100, Martijn van den Burg wrote:

Here's a slight change to Dan's suggestion will satisfy your requirements.

> On Tuesday 04 December 2001 14:13, Dan Collis Puro wrote:
> > Here's a way I do it:
> >
> >
> > my $count;
> > my %header_row= {your hash for your header row};
    
    $header_row{is_header} = 1;  #flag this as a header. hash key name should not 
appear in a data row

> > my @tmpl_loop
> > while (my $info=$handle->fetchrow_hashref){
> >      $count ++;
> >     my %hash;
> >     $hash{VAR1}=$info->{var1};
> > # On the first loop through this will push in the header row, and
> > # then on each 20th loop it will push it in.
> > # Gotta love modulus! The next line is the clincher.
> >      push @tmpl_loop \%header_row if(($count % 20) == 0);
> >      push @tmpl_loop \%hash;
> > }
> 
> 
> That'll do it nicely except that I want my heading rows between <TH>s (these 
> have their own distinctive style) and in the way suggested by you they will 
> be printed betwen <TD>s, making them stand out less. But then, I didn't 
> mention that ;)

In your template, do something like

<TMPL_LOOP ...>
 <TMPL_IF name="is_header">
  <TH> ... </TH>
 <TMPL_ELSE>
  <TD> ... </TD>
 </TMPL_IF>
</TMPL_LOOP>

-Gyepi

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to