我无法使用 css 和 Prince 将分页符放入我的 pdf 中。第二张桌子接触第一张桌子。我究竟做错了什么?我想我可能误解了如何在 css 中使用打印指令,从我的角度来看,我正在做用户指南告诉我的事情(链接)
我的代码如下:
@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>