This is how floating elements behave when they do not fit, they click until they fit (which may not always be in the very left corner of the next "line", if not everything above has the same height, but this is not a problem in your example )
If you want them all to be on the same line, you must make sure that they are all contained in an element that preserves the width for each of them on the same line:
<div class="scrollarea"> <div style="width: 500px;"> <div class="td">x1</div> <div class="td">x2</div> <div class="td">x3</div> <div class="td">x4</div> <div class="td">x5</div> </div> </div>
source share