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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: HTML table creation
by SerZKO (Beadle) on Jul 28, 2012 at 09:48 UTC |