title: HandleBars Check if Index in Each is Divisible by four
body: <p>Not very familiar with handlebars, but I'm using it in a reporting setting, and working with output intended to be printed. The document I'm printing should be four per page, so I want to do a check like <code>if(index%4 === 0)</code> but I'm a little unsure of how to do it. </p>
  
  <p>I'm going through an array of objects with <code>{{#each dataset}}</code></p>
  
  <p>here is the basic layout, and my attempt for my four-per-page report.</p>
  
  <pre><code>&lt;div class="container"&gt;
      {{#each Badges}}
      &lt;div class='cardContainer'&gt;
          &lt;div class="card"&gt;
              &lt;div class="leftCard"&gt;
                  &lt;p&gt;{{Event}}&lt;/p&gt;
                  &lt;p&gt;{{Email}}&lt;/p&gt;
                  &lt;p&gt;{{Name}}&lt;/p&gt;
                  &lt;p&gt;{{Address}}&lt;/p&gt;
                  &lt;p&gt;{{City}} {{State}} {{Zip}}&lt;/p&gt;
              &lt;/div&gt;
              &lt;div class="rightCard"&gt;
                  &lt;h4 class='eventTitle'&gt;{{Event}}&lt;/h4&gt;
                  &lt;h2&gt;{{Name}}
                      &lt;br&gt;
                      &lt;span style='font-size: 26pt'&gt;{{City}} &lt;br&gt; {{State}}&lt;/span&gt;
                  &lt;/h2&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      {{#if @index%4 === 0}}
          &lt;/div&gt;&lt;div class="container"&gt;
      {{/if}}
      {{/each}}
  &lt;/div&gt;
  </code></pre>
  
  <p>The Container will have margins and padding set properly, and each of the reports are contained within the <code>.card</code> class, and the <code>.container</code> class is for the pagination.</p>
  
  <p>What should go in the IF?</p>
  
  <p><strong>This is going to go into <a href="http://jsreport.net/" rel="nofollow noreferrer">jsreport</a> which I'm also not fully familiar with. Not sure if I can register a helper.</strong></p>