Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Just plain dumb

by snowcrash (Friar)
on Jan 09, 2002 at 12:26 UTC ( [id://137406]=note: print w/replies, xml ) Need Help??


in reply to Loop counter only works for 2

in your example the variable $row_count can only have two possible states, either 0 or 2. increment the variable every time you iterate the loop to set it to the actual row you have currently or use something more compact like this:
#!/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";

snowcrash

Replies are listed 'Best First'.
Re: Re: Just plain dumb
by rendler (Pilgrim) on Jan 09, 2002 at 13:54 UTC
    Wow that works great thanks sooo much :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-23 09:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found