adjusting the data structure for table rendering