Table - provides methods to display a table of items via HTML
table_items: a reference to an array of strings, required direction: h: items listed horizontally v: items listed vertically default: v cols: number of columns to display rows: number of rows to display bold: bold font? 0 = no, 1 = yes, default is 0 border Standard table attributes width cellspacing cellpadding align Standard cell attributes valign
use Table; $table_items = ['item1', 'item2', 'item3']; # a reference to an array of strings $table_items = ['item1', 'item2', 'item3', 'item4', 'item5','item6','item7']; $table3 = new Table( 'table_items'=>$table_items, 'direction'=>'h', 'cols'=>2, 'rows'=2, ); print $table3->ToHtml; ## output: ## <table border=0> ## <tr><td>item1<td>item2</tr> ## <tr><td>item3<td>item4</tr> ## </table> $table4 = new Table( 'table_items'=>$table_items, 'rows'=>3, ); print $table4->ToHtml; ## output: ## <table border=0> ## <tr><td>item1<td>item4<td>item7</tr> ## <tr><td>item2<td>item5</tr> ## <tr><td>item3<td>item6</tr> ## </table>
To install Text::PORE, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::PORE
CPAN shell
perl -MCPAN -e shell install Text::PORE
For more information on module installation, please visit the detailed CPAN module installation guide.