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>
相关推荐
面向星辰3 小时前
html各种常用标签
前端·javascript·html
李昊哲小课1 天前
HTML 完整教程与实践
前端·html
小*-^-*九1 天前
php 使用html 生成pdf word wkhtmltopdf 系列2
pdf·html·php
hashiqimiya2 天前
html实现右上角有个图标,鼠标移动到该位置出现手型,点击会弹出登录窗口。
前端·html
BillKu2 天前
Vue3 中使用 DOMPurify 对渲染动态 HTML 进行安全净化处理
前端·安全·html
BUG创建者2 天前
html获取16个随机颜色并不重复
css·html·css3
DevilSeagull2 天前
JavaScript WebAPI 指南
java·开发语言·javascript·html·ecmascript·html5
面向星辰2 天前
html中css的四种定位方式
前端·css·html
IT利刃出鞘2 天前
HTML--最简的二级菜单页面
前端·html
yume_sibai2 天前
HTML HTML基础(4)
前端·html