English 中文(简体)
PHPTAL and specific table
原标题:PHPTAL and specific table

I have to create specific table in PHPTAL. I have array like that:

$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 > tag in right place,但我不想工作。

你们是否有任何想法?

最佳回答
<tr tal:repeat="row php:array_chunk(tab, 2)">
问题回答

暂无回答




相关问题
Why isn t the table centered in Explorer?

This is a HTML email. I have two tables inside each other. One set to 100% and another inside 700px wide. This is the HTML: <table width="100%" border="0" align="center" cellspacing="0"> &...

How to switch from table to div for FORM layout?

I m noticing most folks are talking about using DIVs and CSS for label, textbox pairs. How would one convert a table such as: <table> <tr> <td><some Label1> </td&...

php: parsing table structure with SimpleXML

I m trying to read in an xml file that for some reason has been modeled in a table structure like so: <tr id="1"> <td name="Date">10/01/2009</td> <td name="PromoName">...

Exporting HTML Tables

How can I export an HTML table in my page as PDF and/or XLS? (preferably using JS (+jquery))

Table cells bad rendering with Google Chrome/Webkit

On the following code, COL1A and COL3A are not 50% height with Chrome or Webkit. It works fine with IE7 and Firefox. <table border="1"> <tr> <td height="100%">COL 1A</td>...

热门标签