Sorting on Table Header on textual field or Numeric field with Algolia records

Hi All,
Does anyone has any idea of how to do a sort on table column. I have populated a table with hits in rows and columns using Connector API, where I have a Custom Renderer to generate the HTML table along with data . We have a requirement when the user clicks on any table column header , sort the table by that column ascending or descending. Please share any information regarding this if anyone has done similar customization or there is any approach to do it.