Sorts the rows in a table using a comparisonCriteria or a default ordering if one is not specified.