Page 1 of 1

css shopping cart layout help!

Posted: Mon Sep 13, 2004 9:50 pm
by C_Calav
hey guys i just converted my site to CSS and im having trouble displaying the shopping cart!

i used labels (not sure if this was a good idea now!) and once two or more items are added, they get displayed all wrong.

can someone have a look or help me out? thanx

Code: Select all

<!-- start content -->
<div id="content"> 

<p class="text">

 <label for="aircraft" class="aircraft_lbl"><strong>Aircraft</strong></label>    
 <label for="price" class="price_lbl"><strong>Price Ea</strong></label>   
 <label for="qty" class="qty_lbl"><strong>Qty</strong></label>   
 <label for="sub-total" class="aircraft_lbl"><strong>Sub-Total</strong></label>   
 
 </p>
 
 <p>
 
   <? 
     while($row = mysql_fetch_array($result))
     &#123; 
     // Increment the total cost of all planes 
     $totalCost += ($row&#1111;"qty"] * $row&#1111;"P_Price"]); 
   ?>
 
 <label for="aircraft1" class="aircraft_lbl"> <?php echo $row&#1111;"P_Name"]; ?> </label>  
   
 <label for="price1" class="price_lbl"> $<?php echo number_format($row&#1111;"P_Price"], 2, ".", ","); ?> </label>   
 
 <label for="qty1" class="qty_lbl">		
   <select name="<?php echo $row&#1111;"itemId"]; ?>" onChange="UpdateQty(this)">
    <?php 
      for($i = 1; $i <= 20; $i++) 
      &#123; 
      echo "<option "; 
      if($row&#1111;"qty"] == $i) 
      &#123; 
      echo " SELECTED "; 
      &#125; 
      echo ">" . $i . "</option>"; 
      &#125; 
    ?>
   </select>
 </label>   
 
 <label for="sub-total1" class="aircraft_lbl">		   
      $<?php
			$row&#1111;"subtotal"] = ($row&#1111;"qty"] * $row&#1111;"P_Price"]);
				
			echo number_format($row&#1111;"subtotal"], 2, ".", ","); 
		?>		
 </label>

  <label for="remove"> <a href="cart.php?action=remove_item&id=<?php echo $row&#1111;"itemId"]; ?>Remove</a>    </label>   </p>

	   <? 
      	&#125; //You have to have this read as php 
      ?>
		


		<p>
		 <label for="total" class="total_lbl"> </label><strong> Total: </strong> </label>
	   $<?php 
			echo number_format($totalCost, 2, ".", ","); 
		?> 
						
		<? 
      	&#125; //You have to have this read as php 
      ?>

</p>

</div>
<!-- End Content -->

Posted: Tue Sep 14, 2004 6:17 pm
by zenabi
Could you tell us why you did use labels? To my knowledge labels are used as text attached to controls, for example:

Code: Select all

<label for="username">Username: </label>
<input type="text" name="txtuname" id="username" />
See: http://www.w3.org/TR/REC-html40/interac ... edef-LABEL