我必须在PHPTAL中创建特定的表。我有这样的数组:
$tab = array('item1', 'item2', 'item3', 'item4');最终的表格应该是这样的:
<table>
<tr>
<td>Item1</td>
<td>Item2</td>
</tr>
<tr>
<td>Item3</td>
<td>Item4</td>
</tr>
</table>因此,我尝试使用tal:condition width "repeat/item/odd“和"repeat/item/even”将< tr >标记放在正确的位置,但这并不起作用。
你有什么想法吗?
发布于 2010-07-17 05:00:05
<tr tal:repeat="row php:array_chunk(tab, 2)">https://stackoverflow.com/questions/3071660
复制相似问题