I’m trying to create a system wherein the users can view records in the database, and its corresponding image. My problem is how to present the table in a fashion similar to that of ebay:

Here’s my code:
<?php
require_once('header.php');
?>
<?php $list_items = $db->get_results("SELECT * FROM tbl_products"); ?>
<table border="1">
<?php foreach($list_items as $k=>$li){ ?>
<tr>
<td>
<p>
<img src="../img/items/<?php echo $li->str_filename; ?>" width="150px" height="150px">
</p>
<p>
Product Name: <?php echo $li->str_productName; ?>
</p>
<p>
Category: <?php echo $li->str_category; ?>
</p>
<p>
Quantity: <?php echo $li->dbl_qty; ?>
</p>
<p>
Price: <?php echo $li->dbl_price; ?>
</p>
</td>
</tr>
<?php } ?>
</table>
The current code is outputting the records in list view. Wherein, there’s only one record per row. What I want is 4-6 records per row. How do I do that?
try this