#!/usr/bin/perl -w use CGI qw/:standard :html3/; print header, start_html('Vegetables'), h1('Eat your vegetables'); print table({-border=>undef}, caption(strong('When Should You Eat Your Vegetables?')), Tr({-align=>CENTER,-valign=>TOP}, [ th(['','Breakfast','Lunch','Dinner']), th('Tomatoes').td(['no','yes','yes']), th('Broccoli').td(['no','no','yes']), th('Onions').td(['yes','yes','yes']) ] ) ); print hr, end_html;
Otra forma de hacer una tabla:
#!/usr/bin/perl -w use CGI qw/:standard :html3/; print header, start_html('Vegetables'), h1('Eat your vegetables'); @values = (1..5); @headings = ('N','N'.sup('2'),'N'.sup('3')); @rows = th(\@headings); foreach $n (@values) { push(@rows,td([$n,$n**2,$n**3])); } print table({-border=>undef,-width=>'25%'}, caption(b('Wow. I can multiply!')), Tr(\@rows) ); print hr, end_html;