Product display PROBLEM with PHP + CSS

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I have the folowing code looping thru a result set from the Database and  
displaying a list of products.
I want to use CSS to display 3 products for each line ... or  any number of  
products that will fit in a line and look nice.
So from the php side How can I do something for every 3 records e.x every 3  
records echo "<ul>".

Without any CSS it will display them vertically....

echo "<ul>";
 while ($row_newProd=mysql_fetch_assoc($new_products))

    <?php echo $row_newProd['products_shrt_desc']; ?><br>
    <div align="center"><a href="index.php?products_id=<?php echo  
$row_newProd['products_id']; ?>"><img src="/images/thumb_<?php echo  
$row_newProd['products_img']; ?>" border="0" ></a></div>

<? }
echo "</ul>";


#new_products ul {
 list-style-type: none;
 padding: 0px;
#new_products ul li {
  /*border: 1px dashed #CCCCFF;*/

If you've done something like that, you know what I mean.
So if you have any Idea give me a hint please.


Site Timeline