View Single Post
Old 09-22-2004, 05:35 PM  
lb_vee
Confirmed User
 
Join Date: May 2004
Posts: 886
Quote:
Originally posted by archael
if they are compile in order with my results first, yes thats what I want.

But I need it to have a counter so that after compilation of both arrays, every 6 results will hold a </tr><tr>
Here's an example of how to get a tr after every 6th item.

Code:
my @stuffList = ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19');
my @otherStuffList = ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19');
push (@stuffList,@otherStuffList);
my $length    = @stuffList;
my $perRow    = 5;
my $counter   = 0;
                                                                                                                         
foreach (@stuffList)
{
  print $_;
                                                                                                                         
                                                                                                                         
  if ($counter < $perRow)
  {
    $counter++;
  }
  else
  {
    print "\n"; ### replace with </tr>
    $counter=0;
  }
                                                                                                                         
}
lb_vee is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote