Using CSS to space columns

Associate
Joined
27 Jun 2006
Posts
1,473
Hi guys.

Another numpty question but if I want to set up a table using pure css, how would I go about it?

I have 5 columns:

<--Col1--><--Col2--><--Col3--><--Col4--><--Col5-->

Each column is 150 pixels wide.

I tried doing a single class:

Code:
#col {
     width: 150px;
     position: relative;
}

thinking that would add another 150 pixel column on the left of the previous one - it didn't work :)

As always - advice appreciated!

Cheers
M.
 
make sure you test IE6/7 and Firefox, sometimes IE6 has problem floating more then 3 columns. to overcome this problem you might want to float the 5th column right and clear: both anything underneath.
 
Back
Top Bottom