From: forest Date: 2006-03-17T04:46:27+09:00 Subject: Re: build 3x3 table from one array Thanks all. The each_slice solution I think will work the best for my scenario. I really appreciate the help. forest > >> data = (1..9).to_a > => [1, 2, 3, 4, 5, 6, 7, 8, 9] > >> require "enumerator" > => true > >> puts "" >
> => nil > >> data.each_slice(3) do |row| > ?> puts " " > >> row.each { |cell| puts " " } > >> puts " " > >> end > Hope that helps. > > James Edward Gray II -- Posted via http://www.ruby-forum.com/.
#{cell}