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>
相关推荐
anOnion3 天前
构建无障碍组件之Switch Pattern
前端·html·交互设计
willow8 天前
html5基础整理
html
anOnion11 天前
构建无障碍组件之Radio group pattern
前端·html·交互设计
前端Hardy11 天前
HTML&CSS&JS:丝滑无卡顿的明暗主题切换
javascript·css·html
前端Hardy12 天前
HTML&CSS&JS:基于定位的实时天气卡片
javascript·css·html
前端Hardy12 天前
HTML&CSS:纯CSS实现随机转盘抽奖机——无JS,全靠现代CSS黑科技!
css·html
DeathGhost12 天前
分享URL地址到微信朋友圈没有缩略图?
前端·html
前端Hardy13 天前
HTML&CSS:高颜值产品卡片页面,支持主题切换
css·html
Never_Satisfied13 天前
在HTML & CSS中,nth-child、nth-of-type详解
前端·css·html
你怎么知道我是队长13 天前
前端学习---HTML---块元素和行内元素
前端·学习·html