=========================================================================
use CGI;
use CGI::Pretty;
my $cgi=new CGI;
print $cgi->header;
print $cgi->start_html;
print $cgi->table(
{-border=>undef},
$cgi->caption({-align=>bottom,}, "subject"),
$cgi->Tr(
{-align=>center, -valign=>top},
[
$cgi->th([1,2,3,4,5]),
$cgi->td({-colspan=>3}, "one"), $cgi->td([four, five]), ## not correct
$cgi->td([A, B, C, D, E]),
],
)
);
print $cgi->end_html;
=========================================================================
--
PLEASE NOTE: comp.infosystems.www.authoring.cgi is a
SELF-MODERATED newsgroup. aa.net and boutell.com are
NOT the originators of the articles and are NOT responsible
for their content.
: $cgi->Tr(
: {-align=>center, -valign=>top},
: [
: $cgi->th([1,2,3,4,5]),
: $cgi->td({-colspan=>3}, "one"), $cgi->td([four, five]), ## not correct
: $cgi->td([A, B, C, D, E]),
: ],
: )
The comma in the middle of the line marked "not correct" should be a dot.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
--
Cheers
Ron Savage
r...@savage.net.au
http://savage.net.au/index.html
jackkon <jc...@mail2000.com.tw> wrote in message news:9ficf5$o...@netnews.hinet.net...
: hi all:
: I want to use the perl CGI.pm to create a table.
: The table must have one head and two row.
: The first column must span three columns in the first row.
: How can I write the code in perl cgi.pm module.
: Thanks a lot.
:
Nice try, jackkon. Tested code follows.
-----><8-----
#!/perl/bin/perl
use integer;
use strict;
use warnings;
use CGI;
# ------------------------------------------------------------------
my($q) = CGI -> new();
my(@row) = $q -> td({colspan => 3}, 'Row 1 Col 1');
push(@row, $q -> td('Row 2 col 1') . $q -> td('Row 2 col 2') . $q -> td('Row 2 col 3') );
push(@row, $q -> td('Row 3 col 1') );
print $q -> header(),
$q -> start_html(),
$q -> table
(
{align => 'center', border => 1},
$q -> caption('Some caption'),
$q -> Tr([@row])
),
$q -> end_html();
-----><8-----