How to get 2 columns to display?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi guys,

I'm trying to get two columns of <td></td> to display side by side and
then go to a new row. I am using this code but nothing I seem to do is
working this far. 

<?php
for ($r=0;$products = db_fetch($productsQuery);$r++)
{
?>
      <td align="center"><a href="<?php echo $base_url; ?>products/<?php
echo $category; ?>/<?php echo $products['name_url']; ?>"
class="product_link"><img src="<?php echo $base_url;
?>product_images/thumbs/<?php echo $products['thumb']; ?>" border="0"
width="159"><br><?php echo $products['name']; ?></a></td> <?php  if
((($r+1) % 2) == 0)
 {		
?>
    </tr>
    <tr valign="top">
<?php
 }
}
?>

What is happening with this code is I am getting results like:

<tr>
	<td>IMAGE HERE</td>
	<td>IMAGE HERE</td>
	<td>IMAGE HERE</td>
	<td>IMAGE HERE</td>
	<td>IMAGE HERE</td>
</tr>

What I WANT is:

<tr>
	<td>IMAGE HERE</td>
	<td>IMAGE HERE</td>
</tr>
	<td>IMAGE HERE</td>
	<td>IMAGE HERE</td>
</tr>
	<td>IMAGE HERE</td>
	<td></td>
</tr>

ANY clue where I am going wrong?

Thanks so much.

Aaron

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux