gpt4 book ai didi

html - 无法使用 css 和 prince 使分页符正常工作

转载 作者:行者123 更新时间:2023-11-28 17:31:52 25 4
gpt4 key购买 nike

我无法使用 css 和 prince 在我的 pdf 中分页。第二张 table 与第一张 table 接触。我究竟做错了什么?我想我可能误解了如何在 css 中使用打印说明,从我的 Angular 来看,我似乎正在按照用户指南告诉我的方式进行操作 (link)

我的代码如下:

@page { size: 210mm  297mm;   
}

chapter {page-break-before: always;}

table.page{
width:14cm;
font-family:"Times New Roman";
font-size: 12pt;
border: 1px solid black;
text-align:justify;
padding:0;
margin:0;
}

td.number{
width:1.8cm;
font-family:"Times New Roman" ;
font-size: 12pt;
text-align:justify;
padding:0;
margin:0;
}

td.content{
width:12cm;
font-family:"Times New Roman";
font-size: 12pt;
text-align:justify;
padding:0;
margin:0;
}
<body>
<chapter>
<table class="page">
<tr>
<td colspan="2">
<h1>Title </h1>

</td>
</tr>
<tr>
<td class="number">
<div>1</div>
</td>
<td class="content">
<div>this is some text</div>
</td>
</tr>
</table>
</chapter>
<chapter>
<table class="page">
<tr>
<td colspan="2">
<h1>Title 2</h1>

</td>
</tr>
<tr>
<td class="number">
<div>2</div>
</td>
<td class="content">
<div>this is some more text</div>
</td>
</tr>
</table>
</chapter>
</body>

最佳答案

自己找到答案:章节被认为是空的。如果我使用 table class="page"元素来指定分页符,则可以工作。

关于html - 无法使用 css 和 prince 使分页符正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25912972/

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