hello, i have xml file and parse data to php.

my code is the following :

Code:
<?php
error_reporting(0);
$html = "";
$url= "data.xml";
$xml = simplexml_load_file($url);


//metrame ta items (fylla) analoga me tin ekdosi php tou server

if(phpversion() >= '5.3.0'){
    $bar_count = $xml->channel->item->count();
    }
else    {
    $doc = new DOMDocument();
    $str = $xml->asXML();
    $doc->loadXML($str);
    $bar_count = $doc->getElementsByTagName("item")->length;
    }

for($i =0; $i < $bar_count; $i++) { // dilono ton anotero arithmo (metrimena fylla) 
            $title = $xml -> channel -> item [$i] -> title;
            $date = $xml -> channel -> item [$i] -> pubDate;          
            $category = $xml -> channel -> item [$i] -> category;
            $author = $xml -> channel -> item [$i] -> author;  
            $link = $xml -> channel -> item [$i] -> link;
			
			
echo "<table border='1'>";
           
		   
		   $html  .= "<center><tr><h3>$title : $date</h3>  <a href=$link > <img src=$link height='367' width='300' align='middle' border='0' /></a> </tr></center>";

}

echo "</table>";


echo $html;

echo $count 

?>
code works fine but i have some problem to the output table. It "prints" each record above another but i need 3 records side by side and the next 3 above....


Table with 3 columns

any help appreciate

thanks.