in reply to Re^2: Text::Table formatting with HTML
in thread Text::Table formatting with HTML
You are welcome. I have this sort of passion for HTML tables. :)
If you are processing very large tables then you would be much better off printing out your own tags or even better, using a templating solution like Template:
use strict; use warnings; use Template; my @data =( ["Planet", "Radius\nkm", "Density\ng/cm^3"], [ "Mercury", 2360, 3.7 ], [ "Venus", 6110, 5.1 ], [ "Earth", 6378, 5.52 ], [ "Jupiter", 71030, 1.3 ], ); my $tmpl = '<table>[% FOREACH row = rows %] <tr>[% FOREACH cell = row %] <td>[% cell %]</td>[% END %] </tr>[% END %] </table> '; my $table = Template->new; my $html = ''; $table->process( \$tmpl, { rows => \@data }, \$html ) or warn $table-> +error, $/; print $html;
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|