So nested loops is an obvious solution here in which, inner loop's index depends on the outer loop.
Here's the pseudo code:
for(int i=0; i<size/4 ; i+=4)
<tr> for(int j=i ; j<(i+4) ; j++) //NOTICE: The inner loop index gets initialized with the outer loop index
I haven't tested this, but I assume the logic is correct.
My question is, how to do this with the th:each attribute??? I tired using conditional expressions, iteration status variables etc. But nothing worked.
iteration status variables help to keep track of the index, but i don't how to force a loop to start with custom iteration index.