in reply to Tables with Cgi.pm
If you supply an arrayref to CGI's tr method, it will take each element inside that arrayref to be a distinct row, so you need to remove the [ and ]...
print $query->table( $query->Tr( $query->td({width=>"15%"}, "1"), $query->td( "2"), ), );
The reason for this is so that you can build rows iteratively, and later pass them to tr and have it (ymmv) Do The Right Thing(tm)...
my @rows; foreach my $no (qw( one two three )) { push @rows, $query->td( $no ); } print $query->table( $query->Tr( \@rows ) );
--k.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Tables with Cgi.pm
by mephit (Scribe) on May 12, 2002 at 04:49 UTC |
In Section
Seekers of Perl Wisdom