freemarker遍历tr td

表单遍历,每三个属性为一行
<table cellpadding="0" cellspacing="0"  align="center" class="tab">
    <tr>
        <th colspan="6" align="center">表单明细</th>
    </tr>
    <#if model??>
    <#list model.properties as ps>

        <#if (ps_index+1) % 3 ==1><tr></#if>
            <td class="tit_1">${ps.displayName}${(ps_index+1) % 3}</td>
            <td class="tit_2">${ps.value}</td>
        <#if (ps_index+1) % 3 == 0> </tr></#if>

    </#list>
    </#if>

</table>

结果示意图:


猜你喜欢

转载自blog.csdn.net/an74520/article/details/43817339
td