in reply to alternating row colors
But in your case, you might want to create the table from your SQL query directly:use Data::Table; use strict; my @headers = qw(Col1 Col2 Col3 Col4 Col5); my @data; while (my @row = $query->fetchrow) { push @data, \@row; } my $table = Data::Table->new(\@data, \@headers, 0); print $table->html;
The HTML table has alternate-colored rows by default. You can override the colors by specifying parameters to the html() method call. There are also ways to format the rows and columns, if you need to. Check out Data::Table.use Data::Table; use strict; my $table = Data::Table::fromSQL($dbh, "select * from mytable where blah = ? +", ["blah"]); print $table->html;
buckaduck
|
|---|