From: forest Date: 2006-03-17T02:29:43+09:00 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. Here is the code in JavaScript: var MAX_ROW = 3; var MAX_COL = 3; var nIdx = 0; print(""); for (var r = 0; nIdx < aList.length && r < MAX_ROW; r++) { print(""); for (var c = 0; nIdx < aList.length && c < MAX_COL; c++) { print(""); } // cols print(""); } // rows print("
"); print(aList[nIdx].name); nIdx++; print("
"); Can someone point me in the right direction for how to do this. I found each_index but still was at a loss. Thanks for the help. forest -- Posted via http://www.ruby-forum.com/.