Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: HTML table creation

by tobyink (Canon)
on Jul 28, 2012 at 09:24 UTC ( [id://984173]=note: print w/replies, xml ) Need Help??


in reply to Re^2: HTML table creation
in thread HTML table creation

This does it:

my @Head = ("Anv. ID", "F\xF6r", "Efter", "Pref", "Bef", "Nytt", "Pr", + "F\xF6r", "Kap"); open my $temp, '<', $tempfil or die "Kan inte \xF6ppna filen $tempfil"; print $qry->start_form(-action => "http://skinnmaskin/cgi-bin/kon.cgi" +); print $qry->table( { Border => 1, Cellpadding => 5, bordercolor =>"#FFFFFF" }, Tr(map { th($_) } @Head), (map { my ($Uid, $Fn, $En, $Pr, $Ank, $Ext, $Or, $Adr) = split m{[|]} +; Tr( td(textfield('UID', $Uid, 6)), td(textfield('FNA', $Fn, 20)), td(textfield('ENA', $En, 35)), td(textfield('PRE', $Pr, 10)), td(textfield('BEF', $Ext, 16)), td(textfield('NYTT', $Ank, 5)), td(checkbox('')), td(checkbox('')), td(checkbox('')), ); } <$temp>), #/map ); #/table

Untested of course, as I don't have a copy of your input data. There are certainly better ways to do it (the HTML generation functions of CGI.pm are not how I'd go about generating HTML at all) but it sticks pretty closely to your original code.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^4: HTML table creation
by SerZKO (Beadle) on Jul 28, 2012 at 09:48 UTC

    Thanks man, Works exactly as I wanted. Obviously I didn't know you could use map function in that way, thanks for learning me.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-20 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found