Shaun Fryer wrote:
On Mon, Jan 03, 2005 at 04:06:42PM -0600, [EMAIL PROTECTED] wrote:

Hi, I have a working DBI::Oracle script that I am now trying to get
CGI.pm to HTML-ize the output of, My problem is in the table statement
how can I get the output of the while statement to be in the table? I
have just about beat myself silly trying to figure this out.


You must open the table tag with start_table(). It's in the docs, albeit
a bit obscured by the amount of info.

print h1("Results"),
    start_table({-border=>'1', -width=>'20%'}),
    Tr({-align=>'LEFT', -VALIGN=>'TOP'},
        th({-width=>'30%', -bgcolor=>'#CCCCCC'}, "AU"),
        th({-bgcolor=>'#AAAAAA', -fontcolor=>'#FFFFFF'}, "Certs"),
    );
    while (@row = $sth->fetchrow_array()) {
        print Tr( td( [EMAIL PROTECTED] ));
    }
print end_table();

Off the top of my head ... that should do it.


note that his use of [EMAIL PROTECTED] there is a convenient shortcut for another CGI.pm trick : passing an arraryref to one of the subs will span it across the contents.


print Tr( td( [ qw{ cat dog bird fish } ] ));

results in

<tr>
 <td>cat</td>>
 <td>dog</td>
etc..
</tr>

--
Scott R. Godin
Laughing Dragon Services
www.webdragon.net

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to