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
Last edited by Anarchist; 11-05-2004 at 03:17 PM..
|