How to print on the special table cell column?

Discussion in 'Perl Misc' started by robertchen117@gmail.com, Mar 21, 2007.

  1. Guest

    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.
     
    , Mar 21, 2007
    #1
    1. Advertising

  2. Guest

    On Mar 20, 9:33 pm, ""
    <> 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...
     
    , Mar 21, 2007
    #2
    1. Advertising

  3. gf Guest

    On Mar 20, 8:33 pm, ""
    <> 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?
     
    gf, Mar 21, 2007
    #3
  4. gf Guest

    On Mar 20, 8:33 pm, ""
    <> 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?
     
    gf, Mar 21, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Amirallia

    How Do I Print Table Cell Colours?

    Amirallia, Jan 27, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    519
    teknohippy
    Jan 27, 2005
  2. savvy
    Replies:
    1
    Views:
    476
    savvy
    Jan 18, 2006
  3. Phillip Roncoroni
    Replies:
    14
    Views:
    1,098
    Toby A Inkster
    Apr 5, 2004
  4. keto
    Replies:
    0
    Views:
    958
  5. David Cournapeau

    print a vs print '%s' % a vs print '%f' a

    David Cournapeau, Dec 30, 2008, in forum: Python
    Replies:
    0
    Views:
    359
    David Cournapeau
    Dec 30, 2008
Loading...

Share This Page