title: How to check whether a number is divisible by another in Jinja Template (Django Framework)
body: <p>I am trying to check a simple condition in Jinja Template inside for loop in a web page whether a number is divisible by three or not. 
  I have referred the following link
  <a href="http://jinja.pocoo.org/docs/dev/templates/" rel="nofollow">http://jinja.pocoo.org/docs/dev/templates/</a>
  (Note loop.index doesnt work for me forloop.counter does)</p>
  
  <p>The code is</p>
  
  <pre><code>{% extends "header.html" %}
  {% block content %}
      &lt;h1&gt;List of all Reference Ids&lt;/h1&gt;
      &lt;table class="table table-striped"&gt;
          {% for master in  object_list %}
              {%  if forloop.counter divisibleby 3 %}
                   Do something
              {%endif%}
              &lt;td&gt; &lt;a href="/data/{{ master.id }}"&gt; {{ master.reference_id }} &lt;/a&gt;&lt;/td&gt;
         {% endfor %}
      &lt;/table&gt;
  {% endblock %}
  </code></pre>
  
  <p>Tried various combinations such as below</p>
  
  <pre><code>        {%  if forloop.counter divisibleby 3 %}
          {%endif%}
  
          {%  if forloop.counter divisibleby(3 %}
          {%endif%}
  
          {%  if divisibleby(forloop.counter,3) %}
          {%endif%}
  
          {%  if divisibleby forloop.counter 3 %}
          {%endif%}
  
          {%  if forloop.counter%3==0 %}
          {%endif%}
  </code></pre>
  
  <p>But nothing works. I dont know where I am making the mistake. Please help me out guys I am stuck into this problem for quite long.</p>