Alright, so if you really want to learn the language. You have to use it. So by just giving you the markup and CSS you wouldn't actually gain much. So instead, I'm going to walk you step by step through the thought process, and then help you with markup and CSS.
Doing this with a table is pretty easy, and it's not really tabular data, so let's avoid that. This leaves you with the option of lists or divisions. It really doesn't matter, but for the sake of simplicity, use divisions.
I am looking to create a grid/table for a shopping cart page
Okay, so make this page. You currently don't have content so you would think that it's supposed to be blank. However, you should always start with a basic exoskeleton - so to speak. This is important because your starting with a valid page, and you won't have to worry about adding any of it later.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
</body>
</html> inside the main content container
So in the page simply add a division and give it an ID. Call it container, content, wrapper, or whatever. Just make sure that its purpose is clear.I want the overall grid to be a width of 520px and have a height of 520px
The basis of the grid will be the container division, so your CSS would look something like this:
#container {
width: 520px;
height: 520px;
}
I suggest using a dynamic unit, such a %, instead of px. This will allow the container to adjust to your users screen size. Keep in mind that this width will have to be big enough to compensate for the width of its child-elements, along with their: margin, padding, and borders. If you are unfamiliar with the box model , now is a great time to make friends.
Now for the fun part. The actual grid. Obviously they will be divisions but how will you get them to line up vertically, as well as horizontally? You have a few options: display: inline; , display: inline-block; , and float: left; What do you think? (this isn't a trick question) Keep in mind that the style will have to applied to each division, so instead of using an ID you will have to use a class. We'll worry about the alternating colors later, assuming that you don't figure it out on your own by then.
For now, get everything else set up. This includes all of the divisions for the grid with a width and height. Then post it with any questions, or problems, that you may have.
Regards
Arkinder