[stringtemplate-interest] How to fill a <table> grid wise?

StoreAdmin webmaster at storeadmin.com
Wed Oct 10 16:58:02 PDT 2007


Hi,

I want to fill items into a table grid-wise: i.e. 3 items per row. The 
closest solution I can think of is as following:

<table>
$items : {
   $if (i % 3 = 1)$  <tr>  $endif$
    <td> $it:item_tmpl()$ </td>
$if (i % 3 = 0)$  </tr>  $endif$
}
</table>

which needs a mod(%) expression.

Is there another way to accomplish this without modifying the ST grammar?


More information about the stringtemplate-interest mailing list