Yes... I do know the difference between columns and rows :|
Perhaps a visual will help you better understand:
The module creates a list like this from $i++ and adds a break after each item so it's all in one <td> (column):
<tr>
<td>
Category 1
Category 2
Category 3
Category 4
Category 5
Category 6
Category 7
Category 8
Category 9
Category 10
Category 11
Category 12
Category 13
Category 14
Category 15
Category 16
Category 17
Category 18
Category 19
Category 20
</td>
</tr>
(obviously this is all in a table)
Instead I want it to look like this:
<tr>
<td> <td> <td> <td>
Category 1 Category 6 Category 11 Category 16
Category 2 Category 7 Category 12 Category 17
Category 3 Category 8 Category 13 Category 18
Category 4 Category 9 Category 14 Category 19
Category 5 Category 10 Category 15 Category 20
</td> </td> </td> </td>
</tr>
<br><br>
<tr>
<td>
Category 21
Category 22
etc....
</td>
</tr>
You see Categories 1-5 are in one <td> (one column) Categories 6-10 goes in the next column, etc, until it reaches 20 and breaks off into a new <tr> (a row) and the loop continues.
I see your confusion, you're thinking that Category 1, 6, 11 and 16 are one row but that's not necessary. It could be set either way, sure, but it should be easier to just break off each 5 into a new <td> until 20 and then a new <tr> because it already adds a break after each list item.
This is just a snippet of an enormously complex joomla module that I have no interest in making any more complex than it already is, except for what I'm trying to accomplish here, of course.
Make sense.. at all?