An easy way to access the index of the current iterator being used in your polymer repeat statement, is to use the enumerate filter.
<polymer-element name="my-element">
<template>
<table>
<tbody template repeat="{{item in myList | enumerate}}">
<template if="{{item.index % 3 == 0}}">
<tr>
</template>
<td>item.value</td>
<template if="{{item.index % 3 == 0}}">
</tr>
</template>
</tbody>
</table>
</template>
</polymer-element>
However this is not totally completed as there were issues in the past in which you could not use a <template>
within a table element. I'm not 100% sure if that is still the case or not (as I have been unable to locate any definitive information stating resolution or not). An alternative is to use <div>
's and classes to layout your data.
Simply use some CSS to set the div's style to table
, table-row
, or table-cell
respectively. See CSS Display Property on W3Schools for more information. The <div>
solution would permit templates as required.