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>

結果示意圖:


發佈了92 篇原創文章 · 獲贊 15 · 訪問量 33萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章