SerZKO has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
I need to create a HTML table (within a CGI script) where I define a header fields and then read some variables from a file ("|" delimited) to populate it. I've done it in a following way :
The problem is that I get a table with a header row which does not fit other columns. Now I've thought of using line counter for a file and unless or until or some other alternatives, but I can't get it work ! Can you please help ? Thanks in advance.my @Head = ("Anv. ID", "F\xF6r", "Efter", "Pref", "Bef", "Nytt", "Pr", + "F\xF6r", "Kap"); open (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 =>"#FF +FFFF"}, map {Tr(th($_) )} \@Head); while (<TEMP>) { my ($Uid, $Fn, $En, $Pr, $Ank, $Ext, $Or, $Adr) = split /\|/, $_ ; print $qry->table({ Border => 1, Cellpadding => 5, bordercolor =>" +#FFFFFF"}, 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('')) ) ) ; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML table creation
by davido (Cardinal) on Jul 27, 2012 at 19:24 UTC | |
|
Re: HTML table creation
by CountZero (Bishop) on Jul 27, 2012 at 19:14 UTC | |
|
Re: HTML table creation
by tobyink (Canon) on Jul 27, 2012 at 19:16 UTC | |
by SerZKO (Beadle) on Jul 28, 2012 at 09:11 UTC | |
by tobyink (Canon) on Jul 28, 2012 at 09:24 UTC | |
by SerZKO (Beadle) on Jul 28, 2012 at 09:48 UTC | |
by Anonymous Monk on Jul 28, 2012 at 09:24 UTC | |
by SerZKO (Beadle) on Jul 28, 2012 at 09:57 UTC | |
|
Re: HTML table creation
by Anonymous Monk on Jul 28, 2012 at 02:43 UTC |