How can I perform an action within a for loop every 5 results?
for
Basically I'm just trying to emulate a table with 5 columns.
you could use the modulus operator
for(int i = 0; i < 500; i++) { if(i % 5 == 0) { //do your stuff here } }
1.4m articles
1.4m replys
5 comments
57.0k users