开发者

PHPTAL and specific table

I 开发者_开发知识库have to create specific table in PHPTAL. I have array like that:

$tab = array('item1', 'item2', 'item3', 'item4');

Final table should be look like that:

<table>
    <tr>
        <td>Item1</td>
        <td>Item2</td>
    </tr>
    <tr>
        <td>Item3</td>
        <td>Item4</td>
    </tr>
</table>

So I was trying use tal:condition width "repeat/item/odd" and "repeat/item/even" to fit < tr > tag in right place, but it not working that I want to.

Have you any ideas?


<tr tal:repeat="row php:array_chunk(tab, 2)">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜