有人有使用jsPDF autoTable将表格中的列从pdf结果中排除的经验吗?需要一些帮助。
有人有使用jsPDF autoTable将表格中的列从pdf结果中排除的经验吗?需要一些帮助。
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();
干杯!
doc.autoPrint
的工作原理,但如果你想调用doc.autoTable
,你需要传递列和行。因此,你还需要循环遍历所有行并拼接你想要忽略的列,否则显示的数据可能与正确的列不对应。不过,你指引了我正确的方向。 - actaram