Hi Monks,

Thanks for your reply. I did checked again and corrected few things and the table is created now. But I am facing a issue.

I am reading data from a file, processing it and then trying to put the data in table accordingly. Table has 40 rows and 3 columns. Below is the code:

#!C:\perl\bin\perl.exe use strict; use CGI; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use HTML::Table; my $linecount=0; open(FILE,"details.txt")or die("Sorry can't open $!\n"); my $cgi=CGI->new; print $cgi->header; print $cgi->start_html("Test display page"); print $cgi->h3("Testing the output format"); my $table = new HTML::Table(-rows=>40, -cols=>3, -align=>'left', -border=>1, -width=>'30%', -padding=>5, -head=> ['col1','col2','col3']); OUTER: while(my $line = <FILE>) { chomp($line); my @field=split(/\s+/,$line); for(my $j=1;$j<=24;$j++) { $table->setCell($linecount, $j, $field[($j-1)]); } $linecount++; } close(FILE); print $table->getTable; print $cgi->end_html;

It's printing the columns but data's are not coming somehow. When run the code without html it displays the data. Please help to know where I am going wrong.

Thanks, sir_com

In reply to Re: CGI problem help by sir_com
in thread CGI problem help by sir_com

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.