According to the picture I can place divs beside each other using float but how can I make them fill the free space?

According to the picture I can place divs beside each other using float but how can I make them fill the free space?

You need to use containers for each div e.g:
<div class="container">
<div class="box"></div>
<div class="box"></div>
</div>
<div class="container">
<div class="box"></div>
<div class="box"></div>
</div>
<div class="container">
<div class="box" id="big"></div>
<div class="box"></div>
</div>
You make a container for each column and just float them all.
(I added a class of small and big for size differences.)
<div id="a">
<div class="box small">
</div>
<div class="box big">
</div>
<div class="box small">
</div>
<div class="box big">
</div>
</div>
<div id="b">
<div class="box big">
</div>
<div class="box small">
</div>
<div class="box big">
</div>
<div class="box small">
</div>
</div>
<div id="c">
<div class="box small">
</div>
<div class="box big">
</div>
<div class="box small">
</div>
<div class="box big">
</div>
</div>
The css behind this:
#a,#b,#c {
width:50px;
height:auto;
float:left;
margin:10px;
}
.box {
float:left;
width:50px;
margin:5px;
background-color:#ccc;
}
Check it in action here: http://jsfiddle.net/pvKhQ/