Jump to content

[SOLVED] help with getting 3 columns


wmguk

Recommended Posts

Hey,

 

Can anyone help me, I have a table on my site, and I need to display 3 products per row, and 3 rows per page (total of 9 items)

 

This is my code so far...

 

<table width="900" border="0" cellspacing="0" cellpadding="0">
<?php
	while($row_prod=mysql_fetch_array($result_prod)){ 
	$pid = $row_prod['pid'];
	$name = $row_prod['name'];
	$desc = $row_prod['desc'];
	$price = $row_prod['price'];
	$image = $row_prod['image'];
	} ?>
      
      <tr>
        <td width="100" rowspan="2"><img src="items/<?php echo $photo ; ?>" width="100" height="100" /></td>
        <td width="200" height="80" align="left" valign="top"><p><span class="style22"><?php echo $name ; ?></span><br />
            <span class="style20"><?php echo $desc ; ?></span><br />
        </p></td>
        <td width="100" rowspan="2" align="left" valign="top"> </td>
        <td width="200" align="left" valign="top"> </td>
        <td width="100" rowspan="2" align="left" valign="top"> </td>
        <td width="200" align="left" valign="top"> </td>
      </tr>
      <tr>
        <td height="20" align="left" valign="top"><span class="style14">£<?php echo $price ; ?></span></td>
        <td align="left" valign="top"> </td>
        <td align="left" valign="top"> </td>
      </tr>
      <? } ?>
    </table>

 

any ideas how to reduce it to 3 items wide?

Link to comment
https://forums.phpfreaks.com/topic/169645-solved-help-with-getting-3-columns/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.