Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

(jeffa) Re: Splitting an array into multiple HTML table rows

by jeffa (Bishop)
on Sep 25, 2002 at 17:08 UTC ( [id://200671]=note: print w/replies, xml ) Need Help??


in reply to Splitting an array into multiple HTML table rows

How about something like this:
use strict; use CGI qw(:standard); my @array = (0..11); my $max = 4; my ($i,$j) = (0,0); my $tab; for (@array) { push @{$tab->[$j]},$_; $j++ unless ++$i % $max; } print table(map{ Tr(td $_)} @$tab);

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://200671]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-24 17:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found