Here's a way I do it:

my $count;
my %header_row= {your hash for your header 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;
}



On 4 Dec 2001 at 9:55, Martijn van den Burg wrote:

> Hi *,
> 
> I'm new to the list and haven't seen any reference to a mailing list
> archive (searched google), so please bear with me if this question has
> been asked before.
> 
> I'm using H::T to fill a long and wide table with data obtained from a
> MySQL database. Because the table is long and screen real estate is
> limited the header disappears below the top of the window when
> scrolling down. This requires the users to remember what categories
> there are in the table columns. Some consider this a nuisance andI
> agree.
> 
> I would like to repeat the table heading every twenty rows, is there
> an elegant way to do this?
> 
> Regards,
> 
> Martijn
> 
> -- 
> +----------------------------------+
> | Martijn van den Burg             |
> | ASML, CS PPC Inform@tion Systems |
> | Voice: +31 (0)40 268 3856        |
> +----------------------------------+
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED] For
> additional commands, e-mail: [EMAIL PROTECTED]
> 



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

Reply via email to