mims1979
09-11-2006, 09:48 PM
I've got some php code that sucks products, price, and availability out of a database and then spits it out in the following format:
<div style='float:left; width:33%' align='center'><font size='4'>Product</font></div>
<div style='float:left; width:33%' align='center'><font size='4'>Amount</font></div>
<div style='float:left; width:33%' align='center'><font size='4'>Availability</font></div>
<br><br>
<hr color='#000000'>
<div style='float:left; width:33%' align='center'>Product 1</div>
<div style='float:left; width:33%' align='center'>$20.00</div>
<div style='float:left; width:33%' align='center'><font color='#FF0000'>Out Of Stock</font></div>
<div style='float:left; width:33%' align='center'>Product Name<br>second line</div>
<div style='float:left; width:33%' align='center'>$3.00</div>
<div style='float:left; width:33%' align='center'><font color='#0000FF'>In Stock</font></div>
<div style='float:left; width:33%' align='center'>Product 2</div>
<div style='float:left; width:33%' align='center'>$10.00</div>
<div style='float:left; width:33%' align='center'><font color='#FF0000'>Out Of Stock</font></div>
Under most all circumstances this works fine except for the example above. Whenever I have a <br> in the product name it makes everything else past that point all messed up to where the next product name doesn't start all the way to the left but instead starts right after the product name of the previous item with the "<br>" in the name.
This should display like:
Product Amount Availablity
Product 1 $20.00 Out Of Stock
Product Name $3.00 In Stock
Second line
Product 1 $10.00 Out Of Stock
But instead it displays like:
Product Amount Availablity
Product 1 $20.00 Out Of Stock
Product Name $3.00 In Stock
Second line Product 1 $10.00
Out Of Stock
Does any one have a quick and easy solution for this so that it acts more like a table(without using a table)? I'm relatively new to CSS and have been able to figure pretty much all my other issues out except for this. I don't know enough about positioning, etc to solve this. Can anyone else assist? This is a small example of the output as this normally list 100's of products.
<div style='float:left; width:33%' align='center'><font size='4'>Product</font></div>
<div style='float:left; width:33%' align='center'><font size='4'>Amount</font></div>
<div style='float:left; width:33%' align='center'><font size='4'>Availability</font></div>
<br><br>
<hr color='#000000'>
<div style='float:left; width:33%' align='center'>Product 1</div>
<div style='float:left; width:33%' align='center'>$20.00</div>
<div style='float:left; width:33%' align='center'><font color='#FF0000'>Out Of Stock</font></div>
<div style='float:left; width:33%' align='center'>Product Name<br>second line</div>
<div style='float:left; width:33%' align='center'>$3.00</div>
<div style='float:left; width:33%' align='center'><font color='#0000FF'>In Stock</font></div>
<div style='float:left; width:33%' align='center'>Product 2</div>
<div style='float:left; width:33%' align='center'>$10.00</div>
<div style='float:left; width:33%' align='center'><font color='#FF0000'>Out Of Stock</font></div>
Under most all circumstances this works fine except for the example above. Whenever I have a <br> in the product name it makes everything else past that point all messed up to where the next product name doesn't start all the way to the left but instead starts right after the product name of the previous item with the "<br>" in the name.
This should display like:
Product Amount Availablity
Product 1 $20.00 Out Of Stock
Product Name $3.00 In Stock
Second line
Product 1 $10.00 Out Of Stock
But instead it displays like:
Product Amount Availablity
Product 1 $20.00 Out Of Stock
Product Name $3.00 In Stock
Second line Product 1 $10.00
Out Of Stock
Does any one have a quick and easy solution for this so that it acts more like a table(without using a table)? I'm relatively new to CSS and have been able to figure pretty much all my other issues out except for this. I don't know enough about positioning, etc to solve this. Can anyone else assist? This is a small example of the output as this normally list 100's of products.