$itemunCount = 4;
foreach ($outs as $ks => $items) {
//тут что-то делаю
foreach($items as $key => $itemEls){
for ($tr=1; $tr<=$itemunCount; $tr++){
?>
<td class="tdun_<?=$tr?> razm-col-field" data-color="<?=$itemEls?>_<?=$tr;?>">
<div class="tblinn">
<input class="trt-text" type="text" value="0" name="<?=$itemEls?>" />
</div>
</td>
<?
}
}
}