Note that there are some explanatory texts on larger screens.

plurals
  1. POOrder data in three columns instead of one
    primarykey
    data
    text
    <p>At the moment, with the code from below, I have the data shown like this:</p> <p><a href="http://img27.imageshack.us/img27/8083/29769986.jpg" rel="nofollow">http://img27.imageshack.us/img27/8083/29769986.jpg</a></p> <p>but I want it to be shown like this:</p> <p><a href="http://img259.imageshack.us/img259/3233/24033830.jpg" rel="nofollow">http://img259.imageshack.us/img259/3233/24033830.jpg</a></p> <p>The code for the data shown, as it is on the first image, is:</p> <pre><code>&lt;div id="content"&gt; &lt;?php foreach ($categories as $category) { ?&gt; &lt;div class="manufacturer-list"&gt; &lt;div class="manufacturer-heading"&gt;&lt;?php echo $category['name']; ?&gt;&lt;a id="&lt;?php echo $category['name']; ?&gt;"&gt;&lt;/a&gt;&lt;/div&gt; &lt;div class="manufacturer-content"&gt; &lt;?php if ($category['manufacturer']) { ?&gt; &lt;?php for ($i = 0; $i &lt; count($category['manufacturer']);) { ?&gt; &lt;ul&gt; &lt;?php $j = $i + ceil(count($category['manufacturer']) / 4); ?&gt; &lt;?php for (; $i &lt; $j; $i++) { ?&gt; &lt;?php if (isset($category['manufacturer'][$i])) { ?&gt; &lt;li&gt;&lt;a href="&lt;?php echo $category['manufacturer'][$i]['href']; ?&gt;"&gt;&lt;?php echo $category['manufacturer'][$i]['name']; ?&gt;&lt;/a&gt;&lt;/li&gt; &lt;?php } ?&gt; &lt;?php } ?&gt; &lt;/ul&gt; &lt;?php } ?&gt; &lt;?php } ?&gt; &lt;/div&gt; &lt;/div&gt; &lt;?php } ?&gt; &lt;/div&gt; </code></pre> <p>I order to get the "Hewlett-Packard" text under the "HTC" text, I've changed the "/ 4" into "/ 1", but I have no idea how to make the data to be shown into three columns (like on the second picture), instead of one, as it is now (as shown on the first picture).</p> <p>Thanks in advance.</p> <p><strong>EDIT:</strong> What I actually need, is to count and to do the calculation on this code:</p> <pre><code>&lt;?php foreach ($categories as $category) { ?&gt; . . . &lt;?php } ?&gt; </code></pre> <p>So it needs to count the number of categoris, do the calculations, and present the code between into three columns.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload