Shopping Carts should be Lists?
July 8th, 2008, Category: Uncategorized
I have always made the assumption that shopping carts are tabular data and that its ok to use a table tag for that reason, but thinking semantically they are a list of the items your buying and their parameters. So why not use a list. It validates with W3C’s XHTML validator and the coding is alot cleaner than most ecommerce websites.
I wondered for quite a while how to achieve this and firstly had divs and spans everywhere, then I looked at the data and realized that basically theres 3 lists of information; the product name, the quantity and the price.
So heres the HTML:
<div id="wrapper">
<ul id="products">
<li><h2>Product</h2></li>
<li>black t-shirt - large</li>
<li>blue t-shirt - large</li>
<li>red t-shirt - small</li>
</ul>
<ul id="quantity">
<li><h2>QTY</h2></li>
<li>1</li>
<li>2</li>
<li>4</li>
</ul>
<ul id="price">
<li><h2>Price</h2></li>
<li>£40.20</li>
<li>£40.20</li>
<li>£40.40</li>
</ul>
</div>
The wrapper div can be set to any width and the shopping cart will stretch to fill the void. Heres the CSS:
#wrapper{width: 300px;}
ul{ float: left; margin: 0; padding: 0;}
#products{width: 50%;}
#quantity{width: 25%;}
#price{width: 25%;}
li{list-style:none; }
h2{display: block; margin: 0; padding: 0;}
View the semantic shopping cart to see how it looks, I think I could accomplish a lot more advanced shopping cart designs and also that this would be easier to maintain than its tabular equivalent. Your Thoughts?
-
http://blue-anvil.com Mike Jolley
-
http://blue-anvil.com Mike Jolley
-
http://designbit.co.uk Anthony
-
http://designbit.co.uk Anthony
-
http://blue-anvil.com Mike Jolley
-
http://designbit.co.uk Anthony
-
http://blue-anvil.com Mike Tables Jolley
-
http://designbit.co.uk Anthony
-
http://blue-anvil.com Mike Jolley
-
http://designbit.co.uk Anthony
-
http://www.quartzmtn.com Kevin
-
http://www.dave-woods.co.uk Dave Woods
-
http://designbit.co.uk Anthony
-
http://designbit.co.uk Anthony
-
http://www.dave-woods.co.uk Dave Woods
-
http://green-beast.com/ Mike Cherim
-
http://designbit.co.uk Anthony
-
http://designbit.co.uk Anthony
-
http://www.netage.co.za Jason Marsh – Web Site Designer
-
http://www.hi-techwebdesign.com Custom Web Design Leicester
-
http://www.seniorwebdesigner.com Egypt
-
http://www.paymonthlysites.com Aswathy
-
http://www.digimode.co.uk Digimode
-
http://www.solarisedesign.co.uk Robin
-
http://designbit.co.uk Anthony
-
http://www.corporatewebsolutions.net Diego Herrera
-
http://www.portfoliodesign.ca Allen
-
http://www.portfoliodesign.ca Allen
-
James
-
http://www.midboh.com.au Chris