I know this question was asked many times but still.. i'm not an expert. Below is my code :
  <?php
  $result=mysqli_query($con, $sql)or die(mysqli_error($con));    
  $search_result = "";
  $search_result .= " <table border='0' cellspacing='0' cellpadding='0'><tr>";
    while($row=mysqli_fetch_array($result))
    {
    $id=$row['id'];
    $department=$row['department'];
    $name=$row['name'];
    $extension=$row['extension'];
    $hpno=$row['hpno'];
    $staff_no=$row['staff_no'];
    $birthdate=$row['birthdate'];
    $position=$row['position'];
    $email=$row['email'];
    $image=$row['image'];
    $status=$row['status'];
  $search_result .= " <td height='250' valign='top'><img src='" . $image . "'> </td>
                      <td><table border='0' width='250'>
                           <tr><td height='40' valign='top'><font size='3'><strong>" . $staff_no . " " . $name . "</strong></font></td></tr>
                           <tr><td height='32' valign='top'><i>" . $position . "</i></td></tr>
                           <tr><td height='32' valign='middle'><font color='blue'>" . $email . "</font></td></tr>
                           <tr><td height='32' valign='middle'><img src='mobile.png'> " . $hpno . " | Office Ext : <strong>" . $extension . "</strong></td></tr>
                           <tr><td height='32' valign='middle'>Department : " . $department . "</td></tr>
                           <tr><td height='32' valign='middle'>DOB : " . $birthdate . "</td></tr>
                           <tr><td height='32' valign='middle'>Status : " . $status . "</td></tr>       
                         </table>
                      </td>
                      <td width='20'> </td>";
$table=$table + 1;
if ($table=='3')
{
$search_result .= "</tr><tr>";
$table=0;
}
}
$search_result .= "</table>";
$search_result .= "<br />";
echo $search_result;
?>
<center><?=$pagination?></center>
I put certain part of the code for better understanding. My ideas is to put a table that can replicate 3 rows & 3 column record per page but when i declare $table=0; before $table=$table + 1; its return 9 record vertically
 
     
     
    