I like to wrap 3 elements of a view in a div. I got this code, but it doesn't seem to work. It keeps printing the div but never the /div which makes everything nested in the previous row.
<?php if($i % 3 == 0){ print '<div class="row">'; } ?>
<?php print $row; ?>
<?php if($i % 3 == 2){ print '</div>'; } ?>
Any suggestions?