我在填写jsPDF-autotable的正文时遇到了麻烦。我可以像这样循环吗?
doc.autoTable({
head: [this.pdf_head],
body: [
for(let i = 0; i < this.generated_table.length; i++)
{
for(let j = 0; j < this.generated_column.length; j++)
{
[this.pdf_body[i][j]];
}
}
],
})我使用的是vs-table,所以我不能使用html格式。这段代码目前不能工作,但是有没有办法这样做呢?谢谢!
发布于 2020-11-17 04:11:17
let bodyData = [];
for(let i = 0; i < this.generated_table.length; i++)
{
let rowData = [];
for(let j = 0; j < this.generated_column.length; j++)
{
rowData.push(this.pdf_body[i][j]);
}
bodyData.push(rowData);
}
doc.autoTable({
head: [this.pdf_head],
body: bodyData
})您可以像这样编写代码。
https://stackoverflow.com/questions/64781238
复制相似问题