Zero Brokerage.
Thousands of new listings daily.
100 Cr+ Brokerage saved monthly.
Experience The NoBrokerHood Difference!
Set up a demo for the entire community
Submit the Form to Unlock the Best Deals Today
If you want to exclude specific columns (e.g., an "Actions" column) from the export file, add a custom class like .no-export to those elements, and use jQuery to temporarily hide them before invoking the pdf function, then show them right after.
This script initializes jsPDF, captures the HTML table structure using html2canvas, converts it into an image, and prints it into a downloadable PDF format. javascript download html table as pdf using jquery
$('#download-pdf').on('click', function () { const { jsPDF } = window.jspdf; const doc = new jsPDF(); // AutoTable auto-parses HTML elements directly into vector tables doc.autoTable({ html: '#data-table', theme: 'striped', styles: { fontSize: 10 }, headStyles: { fillColor: [41, 128, 185] } // Custom blue header }); doc.save('clean-vector-table.pdf'); }); Use code with caution. 🛠️ Troubleshooting & Core Best Practices If you want to exclude specific columns (e