title: Php foreach split list into columns (preferably equally)
body: <p>I have an ordered list which is 19 entries long (but could change and be more or less). I'm listing it on a drop down menu but because of its length the column is dropping below the fold of the page. </p>
  
  <p>I'd like to create a separate column (ul or div) to either divide the list into 2 or 3 equally, or have set list sizes e.g. max 7 per list.</p>
  
  <p>Any ideas? Current code:</p>
  
  <pre><code>&lt;div id="colour" class="dropmenudiv"&gt;
  &lt;?php
  $sql = "select * from rug_colours where id &lt;&gt; 0 and active = 1 order by name";
  $rs = $database-&gt;query($sql);
  $index = 0;
  foreach($rs as $v) {
      echo "&lt;a href=\"//$base_url/?action=search&amp;colour=".$v['id']."\" &gt;".$v['name']."&lt;/a&gt;";
  }
  ?&gt;
  </code></pre>