forest wrote:
> 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.
> 
> Here is the code in JavaScript:
*snip*
> Can someone point me in the right direction for how to do this. I found 
> each_index but still was at a loss.

Without giving it a lot of thought, I'd do something to the effect of:

rows = [
    [ 'col1', 'col2', 'col3' ],
    [ 'cOl1', 'Col2', 'col3' ],
    [ 'col1', 'COL2', 'COl3' ],
]

output = ''

output << '<table>'
rows.each do |row|
    output << '<tr>'
    row.each do |col|
        output << "<td>#{col}</td>"
    end
    output << '</tr>'
end
output << '</table>'

puts output

-- 
Posted via http://www.ruby-forum.com/.