print value outside while loop

I want to print values in html table outside while loop. I can not do it in while loop since my header gets repeated for each iteration.
I want something like...
NAME COUNTRY PHONENO abc USA 0000000
pqr AUS 1111111