refactored creation of row and cells for ranking table