Generating html tables on the fly
From: smrtalec (smrtalec_NO_SPAM_at_algxmail.com)
Date: 01/26/04
- Previous message: Arthur J. O'Dwyer: "Re: [crosspost] Perl -> C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 26 Jan 2004 04:10:52 GMT
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)
);
}
- Previous message: Arthur J. O'Dwyer: "Re: [crosspost] Perl -> C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|