takes json data and generates sortable table