title: Play framework templates: how to start a new row in a table?
body: <p>I have list of objects, that I would like to render using Play Framework templates.</p>
  
  <pre><code>@(cats: List[Category])
  
  @category(cat: Category) = {
      &lt;td&gt;&lt;button class="btn btn-info"&gt;@cat.name&lt;/button&gt;&lt;/td&gt;
  }
  
  &lt;div class="modal-body"&gt;
      &lt;table class="table"&gt;
          &lt;tbody&gt;
              @cats.map { case cat =&gt;
                  @category(cat)
              }
          &lt;/tbody&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So if I will have 9 elements in the list, they all will be in a single row.</p>
  
  <p>What I want to have is a row with maximum of 3 elements. So it'll be like: </p>
  
  <pre><code>A B C 
  D E F 
  G H I
  </code></pre>
  
  <p>I thought I can zip my list with index list and set every third element as a new row. But I'm not sure how to do it. </p>
  
  <p>Ideas?</p>
  
  <p>Thanks.</p>