the well-aligned price table $l_r=array( left , right ); $count=0; // counter of elements printed print \n ; foreach ($price as $item => $euro_amount) { print <td align=\ $l_r[$count % 2]\ ; print $item ; $count++; print \n €$euro_amount \n ; $count++; }