title: Prepare table column using PHP array
body: <p>I have this PHP array ($widgets):</p>
  <pre><code>Array
  (
      [company_1] =&gt; Array
          (
              [0] =&gt; advance google map
              [1] =&gt; Advanced Accordion
          )
  
      [company_2] =&gt; Array
          (
              [0] =&gt;  premium tabs
              [1] =&gt; premium alert box
              [2] =&gt; premium animated gradient
          )
  
      [company_3] =&gt; Array
          (
              [0] =&gt; accordion
              [1] =&gt; advance tab
              [2] =&gt; advanced accordion
              [3] =&gt; advanced toggle
              [4] =&gt; behance feed
          )
  
      [company_4] =&gt; Array
          (
              [0] =&gt; audio player
              [1] =&gt; audio playlist
          )
  
      [company_5] =&gt; Array
          (
              [0] =&gt; advance accordion
              [1] =&gt; advance flip box
              [2] =&gt; advanced heading
          )
  
  )
  </code></pre>
  <p>I want to show each company to separate column and under each column, there should be a corresponding option (each columns array elements):</p>
  <p><strong>Something like that I want:</strong></p>
  <pre><code>&lt;tr&gt;
      &lt;td&gt;Company_1&lt;/td&gt;
      &lt;td&gt;Company_2&lt;/td&gt;
      &lt;td&gt;Company_3&lt;/td&gt;
      &lt;td&gt;Company_4&lt;/td&gt;
      &lt;td&gt;Company_5&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;advance google map&lt;/td&gt;
      &lt;td&gt;premium tabs&lt;/td&gt;
      &lt;td&gt;accordion&lt;/td&gt;
      &lt;td&gt;audio player&lt;/td&gt;
      &lt;td&gt;advance accordion&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;Advanced Accordion&lt;/td&gt;
      &lt;td&gt;premium alert box&lt;/td&gt;
      &lt;td&gt;advance tab&lt;/td&gt;
      &lt;td&gt;audio playlist&lt;/td&gt;
      &lt;td&gt;advance flip box&lt;/td&gt;
  &lt;/tr&gt;
  
  and so on... like that
  </code></pre>
  <p>I am getting tried with this below code:</p>
  <pre><code>echo &quot;&lt;table class='table table-bordered'&gt;&quot;;
      // echo &quot;&lt;tr&gt;&quot;;
      //     echo &quot;&lt;td&gt;&lt;/td&gt;&quot;;
      //     echo &quot;&lt;td&gt;&lt;/td&gt;&quot;;
      //     echo &quot;&lt;td&gt;&lt;/td&gt;&quot;;
      //     echo &quot;&lt;td&gt;&lt;/td&gt;&quot;;
      //     echo &quot;&lt;td&gt;&lt;/td&gt;&quot;;
      // echo &quot;&lt;/tr&gt;&quot;;
      
      echo $count = count($widgets);
      echo &quot;&lt;tr&gt;&quot;;
      for($i = 1; $i &lt;= $count; $i++){    
         
          echo &quot;&lt;td&gt;&quot;;
          foreach($widgets['company_'.$i] as $key =&gt; $value){
              echo $widgets['company_'.$i][$key];
              echo '&lt;hr/&gt;';
          }
          echo &quot;&lt;/td&gt;&quot;;
      
          // foreach($widgets['company_'.$i] as $wid){
          //      echo &quot;&lt;tr&gt;&quot;;
          //      echo &quot;&lt;td&gt;$wid&lt;/td&gt;&quot;;
          //      echo &quot;&lt;/tr&gt;&quot;;
          // }
          
         
          
      }
      echo &quot;&lt;/tr&gt;&quot;;
  echo &quot;&lt;/table&gt;&quot;;
  </code></pre>