sort table names for output