开发者

PHPTAL and specific table

开发者 https://www.devze.com 2023-01-03 19:08 出处:网络
I 开发者_开发知识库have to create specific table in PHPTAL. I have array like that: $tab = array(\'item1\', \'item2\', \'item3\', \'item4\');

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

精彩评论

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