add sorting to tables