|
Posted by Advo on 12/13/06 17:02
Hi there.
Im trying to generate a table and its content from a database, and
display it 5 products across, and as many rows as it needs down.
Ive kind of done this, but the products are being listed like:
Name Name Name Name Name Name Name Name Name Name
Image Image Image Image Image Image Image Image Image Image
descr descr descr descr descr descr descr descr descr descr descr
so theyre going across the page for ever and ever, rather than
Name Name Name Name Name
Image Image Image Image Image
Descr Descr Descr Descr Descr
Name Name Name Name Name
Image Image Image Image Image
Descr Descr Descr Descr Descr
if that makes sense. Any ideas please, im pretty stuck. The code is:
for ($i = 0;$i< 5; $i++) {
$j++;
$name .= '<td style="padding-bottom: 3px;">'.
$array_category_name[$i] . '</td>';
$imagename .= '<td>'. '<img src="images/'
..$array_category_image_name[$i] . '" width="74" height="59">' .
'</td>';
$description .= '<td>'. $array_category_description[$i] . '</td>';
}
echo '<table width="100%" border="0" align="center" cellpadding="0"
cellspacing="0">';
echo "<tr align=\"center\">$name</tr>";
echo "<br>";
echo "<tr align=\"center\">$imagename</tr>";
echo "<tr align=\"center\">$description</tr>";
echo "<tr align=\"center\"><td collspan='3' </td></tr>";
echo "</table>";
Navigation:
[Reply to this message]
|