You're still not using curly braces for the inner loop. You misunderstood what I said - I was not suggesting that you move the lines out of the loop, I was pointing out that the indentation did not match the actual truth.
Stop making guesses - think through the logic of the loops. When do you need to start a new line?
I have to ask...why are you outputting the column on line 11 when you already did that on line 3? With line 3, you're set for life - the rest is just printing the row and then printing the actual data on that row, for each row.