如何使用表在特定div中显示mysql数据

I am trying to display the data output in to specific div within a table. I am able to get the table setup and display the first row of the data within the table, but the rest of the output does not make it inside the table. Anyone please can point out what am I doing wrong? Thank you!

<?php include('header.php'); ?>

<?php
     include_once 'scripts/db.php';
     $result = mysqli_query($con,"SELECT * FROM employee");
?>
    <div id="userlist">

      <center><h3>User Listing</h3></center>

       <?php
        echo "<table border='1'>
        <tr>
        <th>Firstname</th>
        <th>Lastname</th>
        <th>location</th>
        </tr>";
       ?>

       <?php
        while($row = mysqli_fetch_array($result))
       {?>

            <div class="userlistoutput">
                <?php
                echo "<td width=120px>" . $row['firstname'] . "</td>";
                echo "<td width=120px>" . $row['lastname'] . "</td>";
                echo "<td width=120px>" . $row['location'] . "</td>";
                echo "</tr>";
                ?>
            </div>

       <? echo "</table>" ?>
       <?php
       }?>
    </div>

<?php 
mysqli_close ($con);
?>

And this is the CSS for userlist:

#userlist {
list-style:none;
width: auto;
margin:30px auto 1px auto;
height:100%;
padding:0px 20px 0px 20px;

/* Rounded Corners */

border-radius: 10px;

/* Background color and gradients */

background:#F4F4F4;
background: -moz-linear-gradient(top, #EEEEEE, #BBBBBB); */
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#EEEEEE), to(#BBBBBB));

/* Borders */

border: 1px solid #002232;
}

That is happening because you have put the </table> inside the while statement. Try changing it to:

<?php include('header.php');
 include_once 'scripts/db.php';
 $result = mysqli_query($con,"SELECT * FROM employee");
?>
<div id="userlist">

  <center><h3>User Listing</h3></center>

   <?php
    echo "<table border='1'>
    <tr>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>location</th>
    </tr>";

    while($row = mysqli_fetch_array($result))
    {
            echo "<tr class='userlistoutput'>;
            echo "<td width='120px'>" . $row['firstname'] . "</td>";
            echo "<td width='120px'>" . $row['lastname'] . "</td>";
            echo "<td width='120px'>" . $row['location'] . "</td>";
            echo "</tr>";
   }
   echo "</table>";
   echo "</div>";
   mysqli_close ($con);
?>