Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Table in Perl CGI

by pme (Prior)
on Aug 02, 2015 at 09:27 UTC ( #1137162=note: print w/replies, xml ) Need Help??


in reply to Table in Perl CGI

Hi Alok,

This is one of the ways.

#!/usr/bin/perl use strict; use warnings; use CGI; my $cgi = CGI->new; my %tbl = ( one => 1, two => 2, three => 3, four => 4, ); print $cgi->header(), $cgi->start_html("Fruits and colors"), $cgi->table({-border=>1}), $cgi->Tr($cgi->th([" Fruit"," Color"])); foreach my $key (sort keys %tbl) { print $cgi->Tr($cgi->td([$key, $tbl{$key}])); } print $cgi->end_table(); print $cgi->end_html();

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2020-01-21 17:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?