Skip to content

Instantly share code, notes, and snippets.

@YerlinMatu
Created February 9, 2019 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YerlinMatu/02275a5a10b860d6095561b2c946451a to your computer and use it in GitHub Desktop.
Save YerlinMatu/02275a5a10b860d6095561b2c946451a to your computer and use it in GitHub Desktop.
TablePDF
<table id="my-table"><!-- ... --></table>
<script src="jspdf.min.js"></script>
<script src="jspdf.plugin.autotable.min.js"></script>
var doc = new jsPDF();
// You can use html:
doc.autoTable({html: '#my-table'});
// Or JavaScript:
doc.autoTable({
head: [['Name', 'Email', 'Country']],
body: [
['David', 'david@example.com', 'Sweden'],
['Castille', 'castille@example.com', 'Norway'],
// ...
]
});
doc.save('table.pdf');
<script src="https://unpkg.com/jspdf"></script>
<script src="https://unpkg.com/jspdf-autotable"></script>
@YerlinMatu
Copy link
Author

Generate table pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment