Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to print on the special table cell column?

Reply
Thread Tools

How to print on the special table cell column?

 
 
robertchen117@gmail.com
Guest
Posts: n/a
 
      03-21-2007
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.

 
Reply With Quote
 
 
 
 
krakle@gmail.com
Guest
Posts: n/a
 
      03-21-2007
On Mar 20, 9:33 pm, "robertchen...@gmail.com"
<robertchen...@gmail.com> wrote:
> 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...


 
Reply With Quote
 
 
 
 
gf
Guest
Posts: n/a
 
      03-21-2007
On Mar 20, 8:33 pm, "robertchen...@gmail.com"
<robertchen...@gmail.com> wrote:
> 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?

 
Reply With Quote
 
gf
Guest
Posts: n/a
 
      03-21-2007
On Mar 20, 8:33 pm, "robertchen...@gmail.com"
<robertchen...@gmail.com> wrote:
> 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?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How Do I Print Table Cell Colours? Amirallia ASP .Net 1 01-27-2005 10:59 AM
How Do I Print Table Cell Colours? Amirallia ASP .Net Web Controls 0 01-27-2005 08:54 AM
How Do I Print Table Cell Colours? Massimo Capetola ASP .Net Web Controls 3 09-29-2004 09:16 AM
How do I have a table cell fetch another page to display within the cell? Phillip Roncoroni HTML 14 04-05-2004 05:58 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57