title: Regarding for loop (template for loop)
body: <p>I have <code>four &lt;div&gt;</code> in one page. I want to display <code>25</code> records on each <code>&lt;div&gt;</code>. I have written messy code. and its not working. Will you please help me ? thanks </p>
  
  <pre><code>    &lt;div one &gt;  &lt;div two&gt;   &lt;div three&gt; &lt;div four&gt;
  1               26          51          76
  2               27          52          77
  3               28          53          78
  -               -           -           -
  -               -           -           -
  25              50          75          100
  &lt;/div&gt;        &lt;/div&gt;     &lt;/div&gt;     &lt;/div&gt;
  </code></pre>
  
  <p>here is template code.</p>
  
  <pre><code> &lt;div class="fourcolumnswrapper"&gt;
        &lt;div class="moviescolumn"&gt;
       {% for movie in movies.object_list %}
      &lt;a href="{{ movie.get_absolute_url}}"&gt;{{ movie.title }}&lt;/a&gt;&lt;br/&gt;
      &lt;!-- Display first 25 record in one div --&gt;
      {% if forloop.counter == 25 %}
  
          &lt;/div&gt;
          {% endif %}
      {% if forloop.counter &gt; 25 and forloop.counter &lt;= 50 %}
          &lt;div class="moviescolumn"&gt;
  
          {% if forloop.counter == 50 %}
              &lt;/div&gt;
          {% endif %} 
      {% endif %}
      {% if forloop.counter &gt; 50 and forloop.counter &lt; 75 %}
          &lt;div class="moviescolumn"&gt;
  
          {% if forloop.counter == 75 %}
              &lt;/div&gt;
          {% endif %} 
      {% endif %}
       {% endfor %}
  
  
      &lt;/div&gt;
  </code></pre>
  
  <p>Update Output: <a href="http://i.imgur.com/zuc8y.png" rel="nofollow">http://i.imgur.com/zuc8y.png</a> Here is source code <code>generated by view source</code> . <a href="http://dpaste.org/dxKi8/" rel="nofollow">http://dpaste.org/dxKi8/</a></p>