Macphisto has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use CGI; my $q = new CGI; print $q->header( -type => "text/html"), $q->start_html, $q->start_table(), $q->Tr( $q->td("Cell1"), $q->td("Cell2") ), $q->Tr( $q->td("Cell3"), $q->td(nested()) ), $q->end_table, $q->end_html; sub nested { $q->start_table(), $q->Tr( $q->td("Cell4"), $q->td("Cell5") ), $q->Tr( $q->td("Cell6"), $q->td("Cell7") ), $q->end_table, }
Cell1 | Cell2 | ||||
Cell3 |
|
#!/usr/bin/perl -w use strict; use CGI; my $q = new CGI; print $q->header( -type => "text/html"), $q->start_html, $q->start_table(), $q->Tr( $q->td("Cell1"), $q->td("Cell2") ), $q->Tr( $q->td("Cell3"), $q->td(nested()) ), $q->end_table, $q->end_html; sub nested { $q->start_table(); for (my $x = 4; $x < 8; $x++) { print $q->Tr( $q->td("cell ". $x), $q->td("cell ". $x+1) ); $x++; } print $q->end_table; }
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <HTML><HEAD><TITLE>Untitled Document</TITLE> </HEAD><BODY><TABLE><TR><TD>Cell1</TD> <TD>Cell2</TD></TR><TR><TD>Cell +3</TD> <TD>1</TD></TR></TABLE></BODY></HTML>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: CGI && tables nested within tables.
by chromatic (Archbishop) on Dec 28, 2000 at 23:41 UTC | |
Re: CGI && tables nested within tables.
by chipmunk (Parson) on Dec 28, 2000 at 23:38 UTC | |
by Macphisto (Hermit) on Dec 29, 2000 at 01:14 UTC | |
by chipmunk (Parson) on Jan 02, 2001 at 23:42 UTC | |
Re: CGI && tables nested within tables.
by epoptai (Curate) on Dec 29, 2000 at 05:51 UTC |