One way that I'd consider is to use an unordered list for it then style your list so that:
i: The "display" property of <li> elements are set to "inline" meaning they don't display underneath each other
ii: The list-style property of <ul> elements set to "none" to remove the bullet points.
You could either just style the <li> elements (using borders, background image, etc etc) or use other nested elements to contain then (<div> etc).
The advantage of using an unordered list is that you need not consider really the widths of the page because the elements will just drop down below each other automatically at the end of the page. Plus, anyone who doesn't have a CSS enabled browser will still be able to access something meaningful (text-browsers, screen readers etc).
The downside is that it is displayed in a strict one after the other then below etc format, however from what it sounds like, that's what you do already in your tables - ie, nothing "complicated"
As for your PHP, just start off the <ul> then use a php loop to throw out <li></li> blocks and then close with <ul>
eg:
Code:
<div id="shopping">
<ul>
<?php
/*Some code to call to your database etc here*/
for ($x=0;$x<mysql_num_rows($DB_QUERY);$x++) {
list($a,$b,$c...)=mysql_fetch_array($DB_QUERY);
echo("<li>\nWhatever other content you want here\n</li>\n");
/*etc etc*/
}
?>
</ul>
</div>
Then style your CSS something like this:
Code:
#shopping ul {
list-type: none;
}
#shopping ul li {
display: inline;
margin: 2px;
padding: 2px;
border 1px solid #abcdef;
color: #fedcba;
text-align: center;
/*Any other CSS your want here*/
}
Hope this helps.
Social Networking Bookmarks