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>
相关推荐
Sapphire~4 小时前
重学前端004 --- html 表单
前端·html
gzzeason7 小时前
在HTML中CSS三种使用方式
前端·css·html
荔枝hu12 小时前
springboot生成pdf方案之dot/html/图片转pdf三种方式
spring boot·pdf·html
灵犀学长18 小时前
解锁HTML5页面生命周期API:前端开发的新视角
前端·html·html5
兴趣使然_1 天前
【笔记】使用 html 创建网址快捷方式
笔记·html·js
Zachery Pole1 天前
BootStrap
前端·bootstrap·html
淮北4941 天前
最简单的实验室资产管理系统,使用Flask,mysql,html(四、知识补充)
mysql·flask·html
多啦C梦a1 天前
【前端必修】闭包、`this`、`箭头函数`、`bind`、节流,一篇文章全懂!
前端·javascript·html
Canaan2851 天前
前端开发-标签
html
爱编程的喵2 天前
深入理解JavaScript节流函数:从原理到实战应用
前端·javascript·html