On Sat, 07 Jun 2003 04:27:32 +0900, Steven Ketcham wrote:

> Perhaps I'm doing this wrong?
> 
> I get <TR>12345</TR> - no cell tags.
> 
>    def doResult()
>       row = [ 1, 2, 3, 4, 5 ]
>       @cgi.out{
>          @cgi.head{ "\n"+@cgi.title{"Test"} } +
>            @cgi.body{
>              @cgi.h1 { "Test" } +
>               @cgi.table ('BORDER' => '1') {
>                 @cgi.tr { row.each { |cell| @cgi.td {"#{cell}"} } }
>               } # table
>           } # body
>         }
>    end

You are not 'plus'ing the <td> elements.

try this:

> cat xxx.rb
require "cgi"
cgi = CGI.new("html3")  # add HTML generation methods
cgi.out() do
        cgi.html() do
                cgi.head{ cgi.title{"TITLE"} } +
                cgi.body() do
                        cgi.table do
                                cgi.tr do
                                        res = ""
                                        [1, 2, 3, 4].each { |col| res += cgi.td {"#{col}"} }
                                        res
                                end
                        end
                end
        end
end
> ruby xxx.rb x
Content-Type: text/html
Content-Length: 178

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2
Final//EN"><HTML><HEAD><TITLE>TITLE</TITLE></HEAD><BODY><TABLE><TR><TD>1</TD><TD>2</TD><TD>3</TD><TD>4</TD></TR></TABLE></BODY></HTML>
>

--
Simon Strandgaard