use while loop to show table