From: "Ashok T." Date: 2011-05-20T23:32:08+09:00 Subject: Looping n rows in table Hello everyone, I am trying to do 'For' loop for the table but i am having a hard time as it involves iteration. Scenario description: I have a table where there are 'n' number of rows but fixed number(5) of columns as shown below. I need to select the dropdown in column 5 if the text presents in Column 4. Just to make clear the rows are infinite and can be any no. Table name: $b.table(:id, /grid/) 1 2 3 4 5 2 100 200 3 101 201 text dropdown 4 102 202 5 103 203 text dropdown n 104 204 Here's what i come up with. i=0 c=$b.table(:id, /grid/)[i][4] d=$b.table(:id, /grid/)[i][5] while i<$b.table(:id, /grid/).row.length if c.text.exist?==true $d.select_list.select "dropdown" else puts "No value present" end end it doesn't iterate and gives incorrect results. Any help would be appreciated. -- Posted via http://www.ruby-forum.com/.