Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: creating HTML table

by neniro (Priest)
on Jul 16, 2007 at 11:22 UTC ( #626818=note: print w/ replies, xml ) Need Help??


in reply to creating HTML table

I'd like to suggest HTML::Table :

#!/usr/bin/perl use strict; use warnings; use HTML::Table; my $data = [map { [ split /,/, $_ ] } (<DATA>)]; my $table = HTML::Table->new( -class => 'sortable', -evenrowclass => 'roweven', -oddrowclass => 'rowodd', -head => ['nr', 'id', 'date'], -data => $data, ); print $table->getTable; __DATA__ 1,X,2002-04-18 2,Y,2004-05-06 3,Z,2007-07-16


Comment on Re: creating HTML table
Download Code
Replies are listed 'Best First'.
Re^2: creating HTML table
by GertMT (Friar) on Jul 16, 2007 at 14:30 UTC
    this looks as straightforward that I can understand it! Never used this module but I'm starting with it now. Creating the html-table is (for me at least) much easier like this then with HTML::template. I can still easilly use the created table in my template via HTML::template.

    Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://626818]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2015-07-30 02:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls