Use div instread of ul and li and make its width 1/3 of the row , or use count integer variable and make logic which insert row after integer divisible by 3.
Use div instread of ul and li and make its width 1/3 of the row , or use count integer variable and make logic which insert row after integer divisible by 3.