use cellIndex to get sortIndex from th