Generating html tables on the fly

S

smrtalec

I am trying to scavange a example script I found on the web. The aubroutine
is below. Basically I want to extract data from a sql db then generate a
table of values on the fly. The script below keeps generating a malformed
header error

sub gen_table {
my $array_ref=query_data('%Ave%');

my @headings = ('id no.','street no.','street name','city');
my @rows = th(\@headings);
foreach my $row_array (@$array_ref) {
my ($id,$str_no,$str_name,$city) = @$row_array;
push(@rows,"td([$id,$str_no,$str_name,$city])");
}
print table({-border=>undef,-width=>'25%'},
caption(b('Wow. I can multiply!')),
Tr(\@rows)
);

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top