Всем привет. Подскажите, как выводить каждые 3 записи таким видом.
<table cellspacing="10" cellpadding="0">
<tr>
<td class="td"><a href="#"><img class="img3" src="<?=base_url();?>img/img4.jpg" /></a>
<p class="text3"><strong>Smiles and Sunshine</strong></p>
<p class="text3"><strong>$34.09</strong></p>
<a href="#"><img class="but" src="<?=base_url();?>img/but1.jpg" /></a>
<p><a class="text4" href="#">Details</a></p> </td>
<td class="td"><a href="#"><img class="img3" src="<?=base_url();?>img/img4.jpg" /></a>
<p class="text3"><strong>Smiles and Sunshine</strong></p>
<p class="text3"><strong>$34.09</strong></p>
<a href="#"><img class="but" src="<?=base_url();?>img/but2.jpg" /></a>
<p><a class="text4" href="#">Details</a></p> </td class="td">
<td class="td"><a href="#"><img class="img3" src="<?=base_url();?>img/img4.jpg" /></a>
<p class="text3"><strong>Smiles and Sunshine</strong></p>
<p class="text3"><strong>$34.09</strong></p>
<a href="#"><img class="but" src="<?=base_url();?>img/but3.jpg" /></a>
<p><a class="text4" href="#">Details</a></p> </td>
</tr>
<tr>
<td class="td"><a href="#"><img class="img3" src="<?=base_url();?>img/img4.jpg" /></a>
<p class="text3"><strong>Smiles and Sunshine</strong></p>
<p class="text3"><strong>$34.09</strong></p>
<a href="#"><img class="but" src="<?=base_url();?>img/but1.jpg" /></a>
<p><a class="text4" href="#">Details</a></p> </td>
<td class="td"><a href="#"><img class="img3" src="<?=base_url();?>img/img4.jpg" /></a>
<p class="text3"><strong>Smiles and Sunshine</strong></p>
<p class="text3"><strong>$34.09</strong></p>
<a href="#"><img class="but" src="<?=base_url();?>img/but2.jpg" /></a>
<p><a class="text4" href="#">Details</a></p> </td>
<td class="td"><a href="#"><img class="img3" src="<?=base_url();?>img/img4.jpg" /></a>
<p class="text3"><strong>Smiles and Sunshine</strong></p>
<p class="text3"><strong>$34.09</strong></p>
<a href="#"><img class="but" src="<?=base_url();?>img/but3.jpg" /></a>
<p><a class="text4" href="#">Details</a></p> </td>
</tr>
</table>