Call us

Two column table effect using css

CSS 1 comment

This is a nice easy one that I used when designing a recent website. I wanted the content area to be split into two equal columns, left and right. Like a table with the cell split in two each at 50% width.

2-column.gif

Obviously we don’t want to use a table for this so I used this simple markup:

div id =”contentleft”
Left content goes here
end “contentleft”

div id =”contentright”
Left content goes here
end “contentleft”

Note: I couldn’t write the div’s out properly because wordpress wouldn’t show them

Now, the css to achieve this is simply:#contentLeft {
float: left;
width:370px;
}

#contentRight {
float: right;
width:370px;
}

You would have different widths depending on what size your content area is, and what size you want the columns to be.

Related Posts

One Response to “Two column table effect using css”

  1. cocowool Says:

    what if the left and right have different height, hwo to make the background color adapt the height, thanks

Leave a Comment