title: Always echo a number of cells which is a multiple of 5 in table (php)
body: <p>What I'm trying to do is when I input a number, it will display the table with 5 value in 1 row. But the problem that I facing is when I input as 67, it doesn't look like what I want.  What I want is always echo a number of cells which is a multiple of 5.</p>
  
  <p>Here's is the output suppose like this, but my output only show until 67, it doesn't show the rest empty cell in table:</p>
  
  <p><img src="https://i.stack.imgur.com/hqTeJ.png" alt="Here&#39;s is the output suppose like this, but my output only show until 67, it doesn&#39;t show the rest empty cell in table"></p>
  
  <p>Here's is my code for input html:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  &lt;form action = "shownumber.php" method="POST"&gt;
  &lt;label&gt;Please input the maximum number : &lt;/label&gt;&lt;input type="number" name="Max_number" required size="20"&gt;&amp;nbsp;&amp;nbsp;&lt;input type="submit"  name="submit" onclick="print_number($Max_number)"/&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here's is my code for php file:</p>
  
  <pre><code>&lt;table&gt;
  &lt;?php
  $Max_number = $_POST["Max_number"];
  function print_number($Max_number)
  {
  $x=1;
  for ($col=1; $col &lt;= 5; $col++) {
  if($x &lt;= $Max_number){
  echo "&lt;td&gt;" . $x . "&lt;/td&gt;";
  $x++;
  }
  else
  echo "&lt;td&gt;&lt;/td&gt;";
  }
  }
  print_number($Max_number);
  ?&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Can someone help me to solve this issue? Thanks.</p>