--- lib/PXElator/html.pm 2009/08/09 21:59:17 187
+++ lib/PXElator/html.pm 2009/08/30 15:54:02 378
@@ -1,6 +1,7 @@
package html;
use Data::Dump qw/dump/;
+use amt;
sub table {
my $cols = shift;
@@ -14,9 +15,14 @@
my @td = map { "
$_ | " } @_;
my $html = qq{\n$th};
+ my $row = 0;
+
foreach ( 0 .. $#td ) {
$html .= $td[$_];
- $html .= qq{
\n} if ( $_ + 1 ) % $cols == 0;
+ if ( ( $_ + 1 ) % $cols == 0 ) {
+ $zebra = $row++ % 2 == 0 ? qq{ style="background: #eee"} : '';
+ $html .= qq{
\n};
+ };
}
$html .= qq{
\n
};
}
@@ -34,12 +40,13 @@
sub tt {
- qq|| . join(' ', @_) . qq||;
+ qq|| . join(' ', @_) . qq|| if @_;
}
sub select {
my $name = shift;
my $selected_option = shift;
+ unshift @_, '' unless $selected_option;
return join("\n"
, qq|