Create print_table method

This method handles all the table printing, which removes a lot of
duplicate code we had before.