Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: alternating row colors

by blue_cowdawg (Monsignor)
on May 18, 2001 at 17:38 UTC ( [id://81495]=note: print w/replies, xml ) Need Help??


in reply to alternating row colors

Disclaimer: I haven't tested this code but this should give you some ideas

my @colors = [ qw ( red blue ) ]; foreach my $ix(0..$#data) { printf "<td><font color=\"%s\">%s</td>", $colors[($ix % 2)],$data[$ix]; }

If it is the background color you are trying to modify substitute "<td>" with "<td bgcolor="%s">".

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Peter L. Berghold --- Peter@Berghold.Net
"Those who fail to learn from history are condemned to repeat it."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-16 05:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found