From: Milo Thurston Date: 2004-06-02T18:03:41+09:00 Subject: CGI - table from csv I am attempting to convert a script that produces csv output into a CGI script that will produce an html table. The following code is the best I can think of (shown here with an example of the data): switch_summary = ["1,2,3,4,5","6,7,8,9,10","11,12,13,14,15"] # example output cgi.out do cgi.html do cgi.head { "\n"+ cgi.title{"Title"} + "\n" } + cgi.body { cgi.h1 { "A pox on cgi scripting"} + cgi.table { switch_summary.each do |val| cgi.tr { val.split(",").to_a.each do |l| cgi.td {"#{l}"} end } + "\n" end } } end end However, rather than producing a table with each element of the array to a line, and each number to a separate cell it produces this: Title

A pox on cgi scripting

1,2,3,4,56,7,8,9,1011,12,13,14,15
I'd therefore be grateful if anyone would explain why, and also point me in the direction of anything that explains cgi scripting without assuming prior knowledge of Perl, for example (I was no good at cgi scripts with that language, either). Thanks. -- www.sirwilliamhope.org