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>
相关推荐
松涛和鸣11 小时前
49、智能电源箱项目技术栈解析
服务器·c语言·开发语言·http·html·php
智航GIS17 小时前
10.5 PyQuery:jQuery 风格的 Python HTML 解析库
python·html·jquery
科雷软件测试2 天前
推荐几个常用的校验yaml、json、xml、md等多种文件格式的在线网站
xml·html·md·yaml
Serendipity-Solitude2 天前
HTML 五子棋实现方法
前端·html
研☆香2 天前
html css js文件开发规范
javascript·css·html
王五周八2 天前
html转化为base64编码的pdf文件
前端·pdf·html
Serendipity-Solitude2 天前
使用HTML创建井字棋
前端·html
Jinuss2 天前
HTML页面http-equiv=“refresh“自动刷新原理详解
http·html
沉默璇年3 天前
如何通过python脚本下载高德离线底图瓦片并使用?
javascript·python·html
BianHuanShiZhe3 天前
swift计算文本高度
前端·javascript·html