css - 使用速度从 html 到 pdf 的分页后更改为横向
问题描述
为了将数据提取到一个 pdf 文档中,我正在使用openhtmltopdf
,velocity
和一个css
样式表。到目前为止它工作正常,但在某些时候我想将页面方向更改为横向,因为我想显示一个包含几列的表格。我尝试<div class="landscape">
使用以下属性创建一个,transform: rotate(270deg);translate(-296mm, 0);
但它不起作用。该表克服了忽略页面格式的几个页面。你能帮忙指出我的错误吗?提前致谢。
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<style>#include("style.css") </style>
<style>
@page {
size: A4;
}
@page {
margin-left: 10mm;
margin-right: 10mm;
margin-top: 10mm;
margin-bottom: 10mm;
}
</style>
</head>
<body class="fontmmMedium">
<div style="padding-top: 5mm"></div>
[...]
## Tableau des Données **
<div class="landscape" style="page-break-before:always;transform: rotate(270deg);translate(-296mm, 0);transform-origin: 0 0;">
<table class="borderGrooveGrey print-page_new" style="width: 100%; padding: 5px; margin-top: 5mm;">
<thead>
<tr>
<th class="borderGrooveGrey" colspan="3" >Données</th>
</tr>
</thead>
<tbody>
<tr></tr>
#foreach ($donnee in $traitementBean.donnees)
<tr>
<td>
$donnne.typeDeDonnees.libelle
</td>
<td>
$donnne.nom
</td>
<td>
$donnne.description
</td>
</tr>
#end
</body>
</table>
</div>
</div>
#end
#end
</body>
</html>
解决方案
推荐阅读
- azure - Azure 用作作业调度程序应用程序
- flutter - 如何在容器父级中将具有行作为子级的列居中
- prolog - Prolog重复元素到多次
- python - 有没有办法在多维列表中找到最高值?
- node.js - NodeJS表单垃圾邮件预防
- sql - 在 SQL Inject 测试的查询号后添加“”的原理是什么?
- c# - 创建一个返回项目数组数组的过滤器
- mongodb - Mongo DB副本集如何为特定集合数据库配置复制
- python - Pandas.DataFrame.GroupBy.agg,聚合函数中需要的独立列。如何将其放入 agg 中?
- python - opencv python将图像读取为RGB