<!DOCTYPE html>
<html>
<body>

<div style="display: table; width: 500px">
  <div style="float: right; width: 100px">one<script>var foo = document.body.offsetWidth;</script></div>
  <div style="float:left; width: 100px">two</div>
</div>

</body>
</html>