2-Spalten PHP Code Layout eleganter


If you performing and elegantly belibeges 2 wants to generate HTML tables crevasse layout without tables, you can e.g.: I tun:

$count = count($array);
for($i = 0; $i < $count; $i++)
{
   $style = !$i%2 ? "left" : "right";
   $html .=  "<div class='$style'>{$array[$i]}</div>";
}

and align with CSS:

#container{width:600px}
.left {width:200px}
.right {width:400px}