首页 文章

在jsPDF AutoTable中排除列

提问于
浏览
0

有没有人经验使用jsPDF autoTable从表中排除pdf结果中的列...可以提供一些帮助 .

2 回答

  • 0

    无论如何,在深入研究API和示例之后 . 我找到了解决方案 . 带有autoTable的jsPDF对于初学者来说有点棘手,因为对于那些将在近期未来陷入困境的人来说 . 这是如何做:

    var tTB = document.getElementById("myTable");
    var atTB = doc.autoTableHtmlToJson(tTB, true);
    var cols = atTB.columns;
    //here you are going to set which column you will truncate. Moreover, .splice(index number of the column(your start), the number of columns you will exclude)
    cols.splice(4,1); 
    doc.text("My Test Table", 40, 60);
    doc.autoPrint();
    

    干杯!

  • 2

    那么你可以使用http://pdfmake.org/来生成pdf客户端 . 使用这个库编写pdf要简单得多 . 他们还有游乐场来复制粘贴您的代码和观看实时pdf .

    谢谢,

相关问题