Sorted table generator