Use divs instead of tables. Start with a single container div that will hold all the others.
<div class="container">
</div>
On each iteration, add a child and change the class of the container to reflect having an odd or even number of children.
first:
<div class="container odd">
<div></div>
</div>
second:
<div class="container even">
<div></div>
<div></div>
</div>
third:
<div class="container odd">
<div></div>
<div></div>
<div></div>
</div>
and so on.
Then just write some css to put .odd
in one column and .even
in two.