Add sorting capability to tables