How to print on the special table cell column?

R

robertchen117

my $cgi = new CGI;
print $cgi->start_table({-border=>0});
print "<tr align=\"left\">";
print $cgi->th('Sunday');
print $cgi->th('Monday');
print $cgi->th('Tuesday');
print $cgi->th('Wensday');
print $cgi->th('Thursday');
print $cgi->th('Friday');
print $cgi->th('Saturday');

Now I have a date, say "0320/2007", How could I print on the
"'Tuesday" column cell?

$cgi->td could do this? If not, how could I do?
Thanks.
 
K

krakle

my $cgi = new CGI;
print $cgi->start_table({-border=>0});
print "<tr align=\"left\">";
print $cgi->th('Sunday');

If you're going to use CGI.pm to generate an HTML table why would you
manually write out 1 line of HTML?

Also, if you KNOW HTML whats the point of limiting yourself with
CGI.pm to output the HTML...

CGI.pm for HTML seemed like a good idea in 1997 for those Perl
programmers who consider HTML greek but to use it now for that reason
is ridiculous to me...

Technically, this is an HTML question that just happens to rely on
CGI.pm... Write out your HTML...
 
G

gf

my $cgi = new CGI;
print $cgi->start_table({-border=>0});
print "<tr align=\"left\">";
print $cgi->th('Sunday');
print $cgi->th('Monday');
print $cgi->th('Tuesday');
print $cgi->th('Wensday');
print $cgi->th('Thursday');
print $cgi->th('Friday');
print $cgi->th('Saturday');

Now I have a date, say "0320/2007", How could I print on the
"'Tuesday" column cell?

$cgi->td could do this? If not, how could I do?

Just as in all things Perl, there are many ways to do it.

This is one...

my $q = new CGI;

print $q->table(
$q->Tr(
[
$q->th( [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday',
'Thursday', 'Friday', 'Saturday' ] ),
$q->td( [ '&nbsp;', '&nbsp;', '03/20/2007', '&nbsp;',
'&nbsp;', '&nbsp;', '&nbsp;' ] )
]
)
),
"\n";


The bigger problem is how do you fit that into your code and data
flow?
 
G

gf

my $cgi = new CGI;
print $cgi->start_table({-border=>0});
print "<tr align=\"left\">";
print $cgi->th('Sunday');
print $cgi->th('Monday');
print $cgi->th('Tuesday');
print $cgi->th('Wensday');
print $cgi->th('Thursday');
print $cgi->th('Friday');
print $cgi->th('Saturday');

Now I have a date, say "0320/2007", How could I print on the
"'Tuesday" column cell?

$cgi->td could do this? If not, how could I do?

Just as in all things Perl, there are many ways to do it.

This is one...

my $q = new CGI;

print $q->table(
$q->Tr(
[
$q->th( [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday',
'Thursday', 'Friday', 'Saturday' ] ),
$q->td( [ '&nbsp;', '&nbsp;', '03/20/2007', '&nbsp;',
'&nbsp;', '&nbsp;', '&nbsp;' ] )
]
)
),
"\n";


The bigger problem is how do you fit that into your code and data
flow?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top