tags:

views:

37

answers:

2

I have a list of divs, with diffrent not fixed height, and I wnat to show them as table.

Example of div list

<div class="container">
   <div class="item">1 some some some text1</div>
   <div class="item">2 a few text2</div>
   <div class="item">3 a lotttttttttttttttttttttttttttttttttttttttttttt of text3</div>
   <div class="item">4some text</div>
   <div class="item">5 some text</div>
   <div class="item">6 some text</div>
<div>

and I want to see it some thing like this: link text

A: 

I recommend using three column divs with float: left and a fixed width (e.g. 30% and a 3% margin to make the gap).

  • Column 1 contains containers 1 and 4
  • Column 2 contains containers 2 and 6
  • Column 3 contains containers 3 and 5

In those divs, you would then have the actual boxes with their varying heights. You would make borders with border: 5px black solid; the gap to the box below would be a margin-bottom: 5px for exampke.

Pekka
I'm understand you but, I can't manege order of divs in list. each of div must select top position in smallest column.
A: 

sry wrong result picture link text