1
大家好我正在尝试增加我指定的列大小列大小,所以我用这样的,列大小增加了,但下一行的影响。这意味着下一行是theme: 'grid',
意味着它不起作用。有人能澄清我吗?这里是我的代码,在jsPdf自动表中获取问题自定义宽度列
doc.autoTable(getColumns(), getData(), //{columnStyles: {steps: {columnWidth: 65}}},
{
\t theme: 'grid', // 'striped', 'grid' or 'plain'
\t headerStyles: {
fillColor: [189, 200, 255],
textColor: [12, 1, 1]
},
// margin: { top: 50, left: 20, right: 20, bottom: 0 },
\t styles: {
\t overflow: 'linebreak',
\t columnWidth: 110,
\t lineWidth: 2,
\t lineColor: [85, 51, 27]
\t
\t },
\t pageBreak: 'avoid',
\t beforePageContent: function(data) {
\t \t doc.setFontSize(10);
\t doc.text("Process Name :"+mainData.name+" || "+"Description :"+mainData.description, 20, 15);
\t
\t },
\t //startY: doc.autoTableEndPosY() + 20,
columnStyles: {
//0: {columnWidth: 200}
}
});
//doc.save("xxx.pdf");
代码发布包含语法呃罗尔斯并没有正确缩进。解决这个问题,我会再看一遍。这表示看起来你的问题是由于没有匹配的括号。您正在向doc.autoTable()发送四个参数,但它只支持三个(两个选项对象) –
语法错误已清除。 –
甜!嗯,你是增加一个单元格的宽度而不是列的宽度? –