我使用下面的 CSS 代码在我的网页中显示有序列表。我已将内容导出到 PDF,然后 PDF 中的有序列表显示不同,如下图链接所示。
ol {
counter-reset: item;
}
ol li { display: block }
ol li:before {
content: counter(item) ". ";
counter-increment: item;
font-weight: bold;
}
Please click here to view the image of the exported ordered list
请检查工作演示:https://plnkr.co/edit/zz6ep51k9ZX1THDDZ8Gj?p=preview 单击导出按钮时,我们可以看到数据已导出并生成了 PDF。在生成的 PDF 中,我们可以注意到有序列表没有按应有的方式正确显示。任何输入都会有所帮助。
最佳答案
ol{
list-style: none;
}
@media print{
ol{
list-style: decimal;
}
}
<ol>
<li>test1</li>
<li>test1</li>
<li>test1</li>
</ol>
关于html - <ol> 导出数据时不符合预期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47087877/