sort table_fields by group and id, key group as top