Had similar issue, could not use jspdf since my legacy code contained multiple tables with several colspan inside. In Jspdf thead > th's must match tbody > tr > td
I ended up using html2pdf package which worked for me
on your file add the library
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.8.1/html2pdf.bundle.min.js" integrity="sha512-vDKWohFHe2vkVWXHp3tKvIxxXg0pJxeid5eo+UjdjME3DBFBn2F8yWOE0XmiFcFbXxrEOR1JriWEno5Ckpn15A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
Get the content you want to save as pdf
var pdf_content = document.getElementById("pdf_body");
Add option or configuration to your file
var options = {
margin: 1,
filename: 'isolates.pdf',
image: { type: 'jpeg', quality: 0.98 },
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
};
Save the file
html2pdf(pdf_content, options);