title: How to display data with in a table format
body: <p>I want to search the data from mysql and need to display it in a table. Here searching of data is successful but the data is not getting displayed in table, instead it is displaying in a straight line. Here am using $output method. My codings are</p>
  
  <h2>form.php</h2>
  
  <pre><code>&lt;html dir="ltr" lang="en-US" &gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8" /&gt;
  &lt;title&gt;Search&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;Seacrh By Name&lt;/h1&gt;
  &lt;form action="search.php" method="get"&gt;
    &lt;label&gt;Name:
    &lt;input type="text" name="keyname" /&gt;
    &lt;/label&gt;
    &lt;input type="submit" value="Search" /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <h2>search.php</h2>
  
  <pre><code>&lt;?php
  
  //capture search term and remove spaces at its both ends if the is any
  $searchTerm = trim($_GET['keyname']);
  
  //check whether the name parsed is empty
  if($searchTerm == "")
  {
  echo "Enter name you are searching for.";
  exit();
  }
  
  //database connection info
  $host = "xx"; //server
  $db = "xx"; //database name
  $user = "xx"; //dabases user name
  $pwd = "xx"; //password
  
   //connecting to server and creating link to database
  $link = mysqli_connect($host, $user, $pwd, $db);
  
  //MYSQL search statement
  $query = "SELECT * FROM customer_details WHERE id LIKE '%$searchTerm%'";
  
  $results = mysqli_query($link, $query);
  
  /* check whethere there were matching records in the table
  by counting the number of results returned */
  if(mysqli_num_rows($results) &gt;= 1)
  {
      $output = "";
      while($row = mysqli_fetch_array($results))
  {
  
  
  $output .= "id: " . $row['id'] . "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
  $output .= "name: " . $row['name'] . "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
  $output .= "Telephone: " . $row['Telephone'] . "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
  $output .= "E_mail: " . $row['E_mail'] . "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
  $output .= "visa_category: " . $row['visa_category'] . "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
  $output .= "other_category: " . $row['other_category'] . "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
  $output .= "passport_no: " . $row['passport_no'] . "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
  $output .= "remarks: " . $row['remarks'] . "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
  
  }
  echo $output;
  }
  else
      echo "There was no matching record for the name " . $searchTerm;
  ?&gt;
  </code></pre>
  
  <p>How can i display my data's in html table. </p>