Handlebars, how to repeat header when looping the data

I have problem with handlebars, after item.breakPage in my code, ember always skip the html tags, anyone can help me ? thanks before :slight_smile:

 <table class="table table-responsive  w960">
                <th class="left" width="20px" >No</th>
                <th class="left" >Description</th>
                <th class="left" >Note.</th>
                <th class="right" >Total</th>
            {{#each item in voucher}}
                <td class="left">{{item.no}}</td>
                <td class="left">{{item.item_description}}</td>
                <td class="left">{{item.item_note}}</td>
                <td class="right">{{format-number item.debit}}</td>
    {{#if item.breakPage}}

{{/if}} {{/each}}
No Description Note. Total
{{header.description}} (+) Total (IDR) {{format-number totalDebit}}

I don’t think you can interleave the opening and closing of tags that way. Perhaps you’ll have to group the items in the controller, each group ending with an item where breakPage is true.

1 Like

Indeed, you can’t wrap starting or closing tags separately.