<?php $num = count($data->att); foreach ($data->att as $k => $d):?>
<?php if($k%1==0){?>
<tr>
<?php }?>
<td class="att"><?php echo $d->attr_name;?>: <?php echo $d->attr_value;?></td>
<?php if($k%1==2){?>
</tr>
<?php }?>
<?php if($k>=4){ break;} ?>
<?php endforeach;?>