This is more an HTML issue than a PHP one. It doesn't matter where the data is, I am assuming that you have it all by the time you are writing out the list (or at least have the information for the item you are writing out).
The best way to format the data the way you want is to use a table row for each item that you are writing out:
<?php
//open database(s), get data
mysql_connect($host, $user, $pwd);
//compose sql select statment
$sql = "select * from item_master";
//execute your querry
$result = mysql_db_query("myStore",$sql);
//write out table header
?>
<table border="0">
<tr><th>Item</th><th>Qty</th><th>Price</th></tr>
<?
// Output each item as a table row
while ($row = mysql_fetch_object($result)) {
print "<tr>";
print "<td>$row['item'];</td>";
print "<td>$row['quantity'];</td>";
print "<td>$row['price'];</td>";
print "</tr>";
}
// output bottom of table
print "</table>";
?>
This generalized algorithm will accomplish what you want. The data for each item will remain in that item's row regardless whether some of the information is not available for some of the items.
Hope this helps.
-- Rich Rijnders
-- Irvine, CA US