html - <ol> 导出数据时不符合预期

标签 html css angularjs twitter-bootstrap

我使用下面的 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 中,我们可以注意到有序列表没有按应有的方式正确显示。任何输入都会有所帮助。

最佳答案

enter image description here

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/

相关文章:

javascript - 不在 View 中时绝对固定在 View 中

HTML5 Input datetime-本地默认值今天和当前时间

javascript - jquery 关闭 ('scroll' ) 不工作

css - 需要降低图像的缩放级别

angularjs - 在前端(混合移动应用程序)使用 ionic/angularjs 并在后端使用 expressjs+passportjs+mongodb 实现 linkedin oauth2

javascript - 在外部 JavaScript 文件中调用函数时出错

css - 相对定位父级的溢出绝对位置伪元素设置为溢出 :hidden

css - 可以显示: flex; be broken?

javascript - ng-model 未在 has-error 类中传递

javascript - Mongoose 模型的数字类型错误?