I am trying to create the following table layout, but I want to use DIV instead of TABLE:
------------------
| | |
| CELL1 | CELL2 |
| |
You need inline-block
and float
: here's the jsFiddle
.list-row {
background:#f4f4f4;
display:inline-block;
border:2px solid red;}
.list-left {
width:auto;
padding:10px;
float:left;
border: 2px solid blue;}
.list-right {
padding:10px;
float:right;
border:2px solid green;}
Also, since you're not using relative
or absolute
positioning, you don't need to specify top
and left
.