in reply to Loop counter only works for 2
#!/usr/bin/perl use warnings; use strict; my $total_sites = 20; my $rows = 4; print qq| <table border="1" width="100%" cellpadding="3" cellspacing="3">\n <tr>\n|; for my $i (1 .. $total_sites) { print "\t<td>number: [$i]</td>\n"; print "</tr>\n<tr>\n" unless ($i % $rows || $i == $total_sites); } print "</tr>\n\n</table>\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Just plain dumb
by rendler (Pilgrim) on Jan 09, 2002 at 13:54 UTC |