Here I walk you through adding the ability to sort table columns in ascending or descending order by clicking the header.

Read more at the source