Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: HTML::Template create table

by neniro (Priest)
on Nov 18, 2007 at 11:55 UTC ( #651504=note: print w/replies, xml ) Need Help??


in reply to HTML::Template create table

Alternatively I'd like to suggest HTML::Template::Compiled. In your script you just need to say:
my $htc = HTML::Template::Compiled->new(filename => "template_whthr.tm +pl"); $htc->param( table => $table ); print $htc->output;
Because it's possible to call methods on objects in HTC you just need the following in your template:
<%= table.html %>
If you prefer your own formatting, it's should be possible to subclass Data::Table to use an own to_html-method.

Replies are listed 'Best First'.
Re^2: HTML::Template create table
by GertMT (Friar) on Nov 18, 2007 at 21:31 UTC
    Thanks for the suggestion. I'll try how it works as it'll improve my understanding of the module and it is more direct as what I'm currently doing. That is, I create the table from Data::Table and do:
    print OUT $table->html
    and then include it with the following in my template.
    <TMPL_INCLUDE NAME="snow.html">
    in my template.
    I'll have to see how this subclass Data::Table is working..? I'm definitely planning to use my own formatting with CSS and stuff like that.
    Thanks

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://651504]
help
Chatterbox?
[Discipulus]: Hi Corion here is holiday: the best we have Liberation Day
[Discipulus]: waiting sons to finish home assignments and we go out to some park
[Corion]: Discipulus: Oh ;) I'm looking forward to 1st of May - the next holiday here ;)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2017-04-25 11:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (449 votes). Check out past polls.