3
Try changing this line:
<{if $mod == 2 || $cat.i == $subcat_count}></tr><{/if}>
to this:
<{if $mod == 3 || $cat.i == $subcat_count}></tr><{/if}>
I believe the problem with the layout is the way it handles "extra" columns. What I mean is...If you make this change it will work for all categories that are divisible by 3 but if you have an odd-ball number like "7" categories then you will run into the same problem again. and since we're dealing with a template that is used for all categories and sub-categories it needs to be able to handle the extra <td>'s where they don't quite fill up the row.
I have the same problem but I haven't had the time to dig in and really correct the problem.
Let me know if you or someone else is able to fix it.
Builderb