in reply to Re^4: CGI table problems
in thread CGI table problems

I see no problem for the same argument to apply (replace the td-content with a table of rows of one td each):
$data .= $cgi->td({-valign=>'top'}, $cgi->table( map{ $cgi->Tr($cgi->td($_) ) } @{render +PartReadView($cgi, $lca_dbm, $am)} );

Replies are listed 'Best First'.
Re^6: CGI table problems
by rashley (Scribe) on Nov 12, 2006 at 16:26 UTC
    I finally got this to work just the way I wanted. I checked the result to see if it was an array ref, then formed a sub-table if it was:
    #massage multi-values for formatting if ( ref $encodedvalue eq 'ARRAY' ) { my $listtable .= $cgi->start_table({-border=>0}); for ( my $i=0; $i<scalar( @$encodedvalue) ; $i++ ) { $listtable .= $cgi->Tr({}, $cgi->th(@$encodedvalue[$i]) ); } $listtable .= $cgi->end_table(); $data .= Tr({}, $cgi->td({-class=>'label'}, $attrHash->{ATTRNAME}), $cgi->td({-class=>'value'}, ($listtable || $cgi->p('&nbsp;')))); } else { $data .= Tr({}, $cgi->td({-class=>'label'}, $attrHash->{ATTRNAME}), $cgi->td({-class=>'value'}, ($encodedvalue || $cgi->p('&nbsp;')))); }}