排除jsPDF AutoTable中的列

One*_*azy 1 javascript jquery jspdf jspdf-autotable

有经验的人使用jsPDF autoTable从表中排除pdf结果中的列。会有所帮助。

One*_*azy 5

无论如何,在深入研究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();
Run Code Online (Sandbox Code Playgroud)

干杯!