#!/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";
In reply to Re: Just plain dumb
by snowcrash
in thread Loop counter only works for 2
by rendler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |