在html / php中我想要的位置表

I am trying to place two tables side by side on a web page but for some reason when I try to position them the second one just goes right underneath the first one. here is my code.

<html>
<body>

<?php

function specificstat($statname){
echo "<table cellpadding=10 border=1>";
  echo "<CAPTION>".$statname."</CAPTION>";
     for($i=1;$i<=10;$i++){ 
    echo "<tr>";
     echo "<td>".$i."</td>";
    echo '<td>test</td>';
    echo "</tr>";
}
 }

 ?>

<div style="position: absolute; top: 20%; left:10%;">

 <?php
 specificstat("Points");
   ?>
</div>

      <div style="position: absolute; top: 20%; left:40%;">


 <?php
 specificstat("Goals");
 ?>

</div>

 </body>
</html>

I have tried using css to position the two divs and that didnt work either. If someone could figure out whats wrong that would be great!

Thanks

Although inline CSS isn't recommended, this should get you on the right track:

<div style="position: absolute; top: 20%; left:10%; float: left;">

I would use float. This positions elements next to each other.

<table cellpadding=10 border=1 style='float:left'>

Another problem is you didn't close the table tag. Fix that and it may do what you want.

}
echo "</table>";
}

close the table between two closing braces set }}