$dbh = DBI->connect("DBI:mysql:$database:$db_server", $user, $password);
$statement = "SELECT city FROM speedtrap WHERE $FORM{state}";
$sth = $dbh->prepare($statement) or die "Couldn't prepare the query: $sth->errstr";
$rv = $sth->execute or die "Couldn't execute query: $dbh->errstr";
$rc = $sth->finish;
$rc = $dbh->disconnect;
So my @row array should have a list of cities that exist for a specific state that can be unlimited in length. I want to print these cities in a HTML table that has four columns:
Obviously the city names in the HTML above should be automatically generated from the array and not statically printed.<TR> <TD width="25%"> <DIV align=center><FONT color=#2f2cff>Wheaton</FONT><BR></DIV></TD> <TD width="25%"> <DIV align=center><FONT color=#2f2cff>Chicago</FONT><BR></DIV></TD> <TD width="25%"> <DIV align=center><FONT color=#2f2cff>Gurnee</FONT><BR></DIV></TD> <TD width="25%"> <DIV align=center><FONT color=#2f2cff>Lisle</FONT><BR></FONT></DIV></TD> </TR>
How can I make a PERL loop that prints my table automatically?
Thanks,
Adam
In reply to Print Array into 4 Column Table by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |