I'm using jspdf to export a table from html to PDF, however my table looks messed up:
This is my table in html:
And lastly, this is my code:
function demoFromHTML() {
var pdf = new jsPDF('p', 'pt', 'letter');
source = jQuery('#customers')[0];
specialElementHandlers = {
// element with id of "bypass" - jQuery style selector
'#bypassme': function(element, renderer) {
// true = "handled elsewhere, bypass text extraction"
return true
}
};
margins = {
top: 30,
bottom: 60,
left: 60,
width: 700
};
pdf.fromHTML(
source,
margins.left,
margins.top, {
'width': margins.width,
'elementHandlers': specialElementHandlers
},
function(dispose) {
pdf.save('Test.pdf');
}
, margins);
}
I'm really confused of why it isn't working properly, I've tried a ton of things but it seems this can only be fixed through jspdf documentation which is almost nonexistant when it comes to exporting tables, I'm REALLY desperate, any help is appreciated.
Thanks :)