Process table using a for loop to print all results