ftl简单demo

1. 遍历列表、获取列表长度、判断语句

html 复制代码
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
    <head>
        <meta charset="UTF-8"/>
        <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <title>Document</title>
    </head>

    <body style=" width: 100%;">

        <font face='arial' style='font-size:10pt;'></font>
        <br/>
        <b>${msgTitle}</b>
        <br/>
        <br/>
        <b>Transaction #</b>: ${entity.transid}
        <br/>
        <b>Transaction Date</b>: ${dateStr}
        <br/>
        <b>Product</b>: ${entity.product}
        <br/>
        <b>Unit Type</b>: ${entity.boardtype}
        <br/>
        <b>Kit #</b>: ${entity.kitnumber}
        <br/>
        <b>Quantity</b>: ${entity.qty}
        <br/>
        <b>Received By</b>: ${entity.recipient}
        <br/>
        <b>Transferred By</b>: ${entity.shipper}
        <br/>
        <b>Comments</b>: ${entity.comments}

        <#if (entity.externalassignment)>
        <br/>
        <b>External Assignment - Shipment / Tracking Info</b>: ${entity.shipinfo}
        <#else>
        <p>
            <br/>
        </#if>

        <table border='1'>
            <tr>
                <th colspan='${barcodeList?size}'>Track IDs Included In This Transaction</th>
            </tr>
            <tr>
                <#list barcodeList as barcode>
                <td align='center'>${barcode}</td>
                </#list>
            </tr>
        </table>
        </p>
        <br/>
        <font size='-2'>Confidential Restricted</font>
    </body>
</html>

2. 列表分块展示

html 复制代码
        <table border='1'>
            <tr>
                <th colspan='5'>Track IDs Included In This Transaction</th>
            </tr>
            <#list barcodeList?chunk(5) as chunk>
                <tr>
                    <#list chunk as item>
                    <td align='center'>${item}</td>
                </#list>
                </tr>
            </#list>
        </table>
相关推荐
Metaphor6923 天前
使用 Python 将 PDF 转换为 HTML
python·pdf·html
a1117763 天前
“黑夜流星“个人引导页 网页html
java·前端·html
JieE2123 天前
手把手带你用纯 CSS 实现一个 3D 旋转魔方,这些前端基础你能打几分?
前端·css·html
YHL3 天前
🧊 CSS 3D 硬核解析:四个属性手写旋转立方体
前端·css·html
a1117763 天前
无限森林漫游(简约几何版 html
前端·html
LaughingZhu3 天前
Product Hunt 每日热榜 | 2026-06-16
前端·人工智能·经验分享·chatgpt·html
m0_547486664 天前
《HTML+CSS+JavaScript+Vue前端开发技术教程》全套PPT课件
javascript·css·html
fastjson_4 天前
Edge浏览器开启IE兼容模式
javascript·edge·html
艾伦野鸽ggg4 天前
web 组大一下第二次考核
前端·css·html
货拉拉技术4 天前
Huolala Figma MCP 原理与实践
人工智能·前端框架·html