The code is nothing special, here's a simplified version:
<div id='DIV1' style="border: solid 1px red">
Content, content, content
<div id='DIV2' style="border: solid 1px blue">content, content, content on a separate line</div>
Some more content
<div id='DIV3' style="float: right; border: solid 1px green">content - operation buttons</div>
What I'm looking for is something like vertical-float: top. This is a structure for a record, that I take from a DB. DIV3 has the operation buttons, I can print it only after all the records are printed.