hi guys,
i have nearly finished converting my website to CSS and im a bit stuck on the shopping cart page.
what would be the best way to display the contents of my shopping cart?
i used labels, but when i had 2 or more products in the it didnt display to well at all!
let me explain, when i added one item, everything was in correct order. eg the name was under the name heading, price under the price heading etc
but when 2 or more items were in the, the second items names, and prices etc were under different headings!
should i not have used labels? or what>?
thanx guys in advance!
<!-- 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))
{
// Increment the total cost of all planes
$totalCost += ($row["qty"] * $row["P_Price"]);
?>
<label for="aircraft1" class="aircraft_lbl"> <?php echo $row["P_Name"]; ?> </label>
<label for="price1" class="price_lbl"> $<?php echo number_format($row["P_Price"], 2, ".", ","); ?> </label>
<label for="qty1" class="qty_lbl">
<select name="<?php echo $row["itemId"]; ?>" onChange="UpdateQty(this)">
<?php
for($i = 1; $i <= 20; $i++)
{
echo "<option ";
if($row["qty"] == $i)
{
echo " SELECTED ";
}
echo ">" . $i . "</option>";
}
?>
</select>
</label>
<label for="sub-total1" class="aircraft_lbl">
$<?php
$row["subtotal"] = ($row["qty"] * $row["P_Price"]);
echo number_format($row["subtotal"], 2, ".", ",");
?>
</label>
<label for="remove"> <a href=http://www.webdeveloper.com/forum/archive/index.php/"cart.php?action=remove_item&id=<?php echo $row["itemId"]; ?>Remove</a> </label> </p>
<?
} //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, ".", ",");
?>
<?
} //You have to have this read as php
?>
</p>
</div>
<!-- End Content -->would a table be more appropriate in this instance? e.g. isn't this really tabulated data?Yeah i would say use a table just remember semantics and you'll be fine it its a header mark it as a header.
i have nearly finished converting my website to CSS and im a bit stuck on the shopping cart page.
what would be the best way to display the contents of my shopping cart?
i used labels, but when i had 2 or more products in the it didnt display to well at all!
let me explain, when i added one item, everything was in correct order. eg the name was under the name heading, price under the price heading etc
but when 2 or more items were in the, the second items names, and prices etc were under different headings!
should i not have used labels? or what>?
thanx guys in advance!
<!-- 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))
{
// Increment the total cost of all planes
$totalCost += ($row["qty"] * $row["P_Price"]);
?>
<label for="aircraft1" class="aircraft_lbl"> <?php echo $row["P_Name"]; ?> </label>
<label for="price1" class="price_lbl"> $<?php echo number_format($row["P_Price"], 2, ".", ","); ?> </label>
<label for="qty1" class="qty_lbl">
<select name="<?php echo $row["itemId"]; ?>" onChange="UpdateQty(this)">
<?php
for($i = 1; $i <= 20; $i++)
{
echo "<option ";
if($row["qty"] == $i)
{
echo " SELECTED ";
}
echo ">" . $i . "</option>";
}
?>
</select>
</label>
<label for="sub-total1" class="aircraft_lbl">
$<?php
$row["subtotal"] = ($row["qty"] * $row["P_Price"]);
echo number_format($row["subtotal"], 2, ".", ",");
?>
</label>
<label for="remove"> <a href=http://www.webdeveloper.com/forum/archive/index.php/"cart.php?action=remove_item&id=<?php echo $row["itemId"]; ?>Remove</a> </label> </p>
<?
} //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, ".", ",");
?>
<?
} //You have to have this read as php
?>
</p>
</div>
<!-- End Content -->would a table be more appropriate in this instance? e.g. isn't this really tabulated data?Yeah i would say use a table just remember semantics and you'll be fine it its a header mark it as a header.