gpt4 book ai didi

java - 目录 java Flying Saucer ?

转载 作者:行者123 更新时间:2023-12-04 14:53:19 27 4
gpt4 key购买 nike

我使用飞碟创建了一份审计报告,将 HTML 转换为 pdf。我想在第一页创建一个目录来知道 titleProduct 属于哪个页面?我该怎么做?

<div th:each="productGroup: ${productGroups}">
<table class="audit-table">
<thead>
<tr class="pg-node pg-title">
<td class="titleProduct" colspan="3">[[${productGroup.getPgNumber()}]] - [[${productGroup.getPgName()}]]</td>
</tr>
<tr class="pg-node row">
<th>BRAND</th>
<th>MODEL</th>
<th>FEATURE TEXT</th>
<th>ARTICLE</th>
</tr>
</thead>
<tbody>
<th:block th:each="audit: ${productGroup.getPdfAuditColumns()}">
<tr>
<td th:text="${audit.getBrand()}"></td>
<td th:text="${audit.getModel()}"></td>
<td th:text="${audit.getFeatureText()}"></td>
<td th:text="${audit.getArticle()}"></td>
</tr>
</th:block>
</tbody>
</table>
</div

最佳答案

您可以使用 CSS cross references 创建目录.这是飞碟支持的。

这是一个工作示例:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
div.newbr {page-break-before: always}
#table-of-content a::after {content: " on page " target-counter(attr(href), page);}
</style>
</head>
<body>

<div id="table-of-content">
<a href="#product1">Product 1</a><br/>
<a href="#product2">Product 2</a><br/>
<a href="#product3">Product 3</a><br/>
</div>

<div id="product1" class="newbr"><h1>Product 1</h1></div> <!-- product 1 on page 2 -->
<div id="product2"><h1>Product 2</h1></div> <!-- product 2 also on page 2 -->
<div id="product3" class="newbr"><h1>Product 3</h1></div> <!-- product 3 on page 3 -->


</body>
</html>

关于java - 目录 java Flying Saucer ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68634607/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com