Baz has asked for the wisdom of the Perl Monks concerning the following question:
I now want to break my table into a number of smaller tables something similar to the following...my @tableCont; while(***) { push(@tableCont,td(***).td(***)); } print startform(***), table(Tr(/@tableTop),Tr(/@tableCont)), submit(***),end_form);
So now, for example, lets say there are 30 entries(rows) in my SQL table, the WHILE loop will, for this case, exectute 30 times. And lets say i want to create 3 different tables based on this data, i.e. Table 1 = row 0 ..9 Table 2 = row 10..19 and Table 3 = 20..29. OR Table[i%10] = row(i), where i is the ith iteration of the while loop.print startform(***), table(Tr(/@tableTop),Tr(/@tableCont_1)), table(Tr(/@tableTop),Tr(/@tableCont_2)), table(Tr(/@tableTop),Tr(/@tableCont_3)), submit(***),end_form);
My 3 tables acould then be constructed as /@tableCont[0],/@tableCont[1] and /@tableCont[2]while($i<30) { $i++ push(@tableCont[i%10],td(***).td(***)); }
Edited 2001-12-13 by Ovid
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(shockme) Re: An array of arrays
by shockme (Chaplain) on Dec 14, 2001 at 00:10 UTC | |
|
Re: An array of arrays
by r3b3lxd (Initiate) on Dec 20, 2001 at 20:30 UTC | |
|
Re: An array of arrays
by andye (Curate) on Dec 14, 2001 at 20:06 UTC |