Build 3x3 table from one array


If you don't mind a 3rd party solution:

require 'html/table'
include HTML

array = [1,2,3,4,5,6,7,8,9]

table =

puts table.html



-----Original Message-----
[] On Behalf Of forest
Sent: Thursday, March 16, 2006 10:30 AM
To: ruby-talk ML
Subject: build 3x3 table from one array

I am new to ruby and still haven't got my mind around
iterators although
I think they are really cool.

I am stuck trying to figure out how to take an array of data and
dynamically build a 3x3 html table from it without standard for loops.