Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Help with loops dealing with two arrays
Old 11-05-2004, 03:13 PM Help with loops dealing with two arrays
Junior Talker

Posts: 1
Trades: 0
Hi,
I am looking for some guidance involving Perl at the moment, I am trying to write a script that uses another script [required] to get its values. this is this first time I have tried this and have come across a problem, after bangin my head for several hours, I have decided to ask for help.

The script I am writing is supposed to build a table populated by the values defined in a seperate .pl file.

I get so far and crasssh it goes south, the problem is my loops, I need to place the table data alongside the table headers but i cannot get the thing to do what I want.


here's my code so far:

Code:
#!/usr/bin/perl
require "tabledata.pl";
print "Content-type: text/html\n\n";
print "<table border=\"3\">\n";
print "\n";
print "<caption>$caption</caption>\n";
print "<tr>\n";
print "<th colspan=\"2\" rowspan=\"2\">$year</th>\n";
print "<th colspan=\"6\">$coltop</th>\n";
print "<th colspan=\"2\" rowspan=\"2\">$lastcoltitle</th>\n";
print "</tr><tr>\n";

for ( $i=0 ; $i < scalar @branch; ++$i ) {;
print"<th>";
print $branch[$i];
print"</th>";
};

print "</tr><tr>\n";
print "<th rowspan=\"12\">$rowtop</th>\n";
for ( $i=0 ; $i < scalar @month; ++$i ) {
print "<tr><th>$month[$i]</th>\n";
 };

for ( $i=0 ; $i < scalar @sales; ++$i ) {print "<td>$sales[$i]<br></td> ";

   };




print "</table>\n";
I've included a gif of what the table should look like
Attached Files
File Type: zip tabledata.zip (1.2 KB, 4 views)
File Type: zip salestable.zip (24.8 KB, 2 views)

Last edited by Anarchist; 11-05-2004 at 03:17 PM..
Anarchist is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Help with loops dealing with two arrays
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.43224 seconds with 13 queries