Do you basically wants to scrape all the data from the table and then move to the next page and do the scraping again there and continue to all pages right?
I don’t think you need a for each row loop for that. You can simply use the data scraping wizard. You can get to the data scraping wizard from the top ribbon of the Studio.
Once in the wizard, mention the columns you want to be scraped from the table. Once the columns are set, it will ask whether there is a next page button that it can use to continue and scrape. There you can indicate the next page button. This will work irrespective of the number of records shown in the table on a give page. So ots more error proof and efficient
I suppose this is what you are looking for?