Add sorting to tables