Remove table/cell border
Hi,
how do you completely remove any table/cell borders? Currently this is our setup:
doc.autoTable(columns, rows, {
styles: {
cellPadding: 0,
rowHeight: 10,
fillStyle: 'S',
halign: 'center',
valign: 'middle',
fontStyle: 'bold',
lineWidth: 0.01,
fontSize: 10,
textColor: 0,
},
margin: [68, 0, 0, 140] ,
tableWidth: width / 2 - 4,
bodyStyles: {
lineColor: [0, 0, 0, 0]
},
drawHeaderRow: function() {
return false;
},
beforePageContent: function(data) {
doc.addImage(imgData, 'JPEG', 0, 0, width, height);
}
});
The above seems to work with mac/ios safari and ff but mac chrome adds a thin white border. Tried also with: lineWidth: 0.00, lineWidth: 0.0, lineWidth: 0,
What we need to achieve is have a background image with the table but no table backgrounds or borders.
Have you tried the plain theme?
Yes and same thing with mac chrome showing the thin white border but mac ff and safari not showing it. Code:
doc.autoTable(columns, rows, {
theme: 'plain',
styles: {
cellPadding: 0,
rowHeight: 10,
fillStyle: 'S',
halign: 'center',
valign: 'middle',
fontStyle: 'bold',
lineWidth: 0.01,
fontSize: 10,
textColor: 0,
},
margin: [68, 0, 0, 140],
tableWidth: width / 2 - 4,
bodyStyles: {
lineColor: [0, 0, 0, 0]
},
drawHeaderRow: function () {
return false;
},
beforePageContent: function (data) {
doc.addImage(imgData, 'JPEG', 0, 0, width, height);
}
});
Sounds strange! So you are seeing a border in the plain theme in the demo as well? https://simonbengtsson.github.io/jsPDF-AutoTable/#themes
I use chrome on mac and can't see it. Can you post a screenshot?
No not seeing the borders on the plain demo but granted the background is white and we have the image background.
Mac chrome, with borders:

Mac ff, no borders:

This was a bug. Fixed it now in version 2.0.36. If you specify the style lineWidht: 0 no border will show. You don't need to do that with the plain style set however as that is the default. Let me know if it works for you!
Ah, thanks for the heads up. We were loading the script from per read me's "It is also available on cdnjs:" but just DL'd the latest version and all good.
Closing topic.
Oh! My bad, updated the readme with the latest version now.