title: how to create table with dynamic column using php
body: <p>Suppose there is a number of item in array.which may be odd or even like I  have an array which contain item from a to z Now I want to display that item in table . But As you know That There are 23 alphabets I want to display these alphabets in table which contains only 5 column in the last you got only three alphabets I want to display them in table . In the last I want that there should be three column not 5.</p>
  
  <p>Here is my code i could not get that what should i do?</p>
  
  <p>But the problem I faced in the below code is that the second loop is not correct.</p>
  
  <pre><code>&lt;?php
  $arr=array('a','b','c','d','e','f','g','h');
  $count=  sizeof($arr);
  $row=ceil($count/5);
  echo "&lt;table border='1'&gt;";
  for($r=0;$r&lt;$row;$r++){    
  echo "&lt;tr&gt;";
      for($j=0;$j&lt;=5;$j++){
      echo "&lt;td&gt;'".$arr[$j]."'&lt;/td&gt;";
      }
  
  echo "&lt;/tr&gt;";
  
  }
  echo "&lt;/table&gt;";
  ?&gt;
  </code></pre>