J
Justin C
I'm using CGI.pm to generate a table, and within that table I'm using
map to put the contents of an arrayref into cells within each table row:
print table(
{ get_formatting_string($formatting) },
Tr({-class=>'holding'},
[
th([@{$col_heads}]),
map { td($_) } @{$data},
],
),
);
Here's what Data:
umper says about $data:
$VAR1 = [ '2010-10-01', 'First consignment of two. Order split due to size.', 'John Smith' ];
$VAR2 = [ '2010-10-21', 'Sent email requesting payment. If no joy by follow-up date then set a deadline.', 'Justin' ];
The problem I'm having is that when the second column has a lot of text
it causes the first column to shrink and wrap and this looks terrible. I
can fix this with td({-nowrap=>'nowrap}, $_) if doing things manually,
but I'd still like map to handle this for me because I'm using the same
sub to print tables with different numbers of columns.
How can I set a parameter for the first item while still letting map
handle this? ... or how else could I do this?
Thanks for any help you can give with this.
Justin.
map to put the contents of an arrayref into cells within each table row:
print table(
{ get_formatting_string($formatting) },
Tr({-class=>'holding'},
[
th([@{$col_heads}]),
map { td($_) } @{$data},
],
),
);
Here's what Data:
$VAR1 = [ '2010-10-01', 'First consignment of two. Order split due to size.', 'John Smith' ];
$VAR2 = [ '2010-10-21', 'Sent email requesting payment. If no joy by follow-up date then set a deadline.', 'Justin' ];
The problem I'm having is that when the second column has a lot of text
it causes the first column to shrink and wrap and this looks terrible. I
can fix this with td({-nowrap=>'nowrap}, $_) if doing things manually,
but I'd still like map to handle this for me because I'm using the same
sub to print tables with different numbers of columns.
How can I set a parameter for the first item while still letting map
handle this? ... or how else could I do this?
Thanks for any help you can give with this.
Justin.