I spent a lot of time looking for a good representation of my tables, then I found this plugin (https://github.com/simonbengtsson/jsPDF-AutoTable), It works great, includes themes, rowspan, colspan, extract data from html, works with json, you can also personalize your headers and make them horizontals. The image below is an example:

Answer from Oscar Acevedo on Stack Overflow
🌐
GitHub
github.com › simonbengtsson › jsPDF-AutoTable
GitHub - simonbengtsson/jsPDF-AutoTable: jsPDF plugin for generating PDF tables with javascript
--></table> autoTable(doc, { html: '#my-table' }) // Or use javascript directly: autoTable(doc, { head: [['Name', 'Email', 'Country']], body: [ ['David', '[email protected]', 'Sweden'], ['Castille', '[email protected]', 'Spain'], // ... ], }) doc.save('table.pdf') You can also use the plugin methods directly on the jsPDF documents:
Starred by 2.5K users
Forked by 637 users
Languages   TypeScript 89.5% | HTML 7.6% | JavaScript 2.9%
Discussions

Generate a pdf table with the jspdf library
i managed to make simple pdf pages with some text and images on the “page”, but now comes the hard thing. I stored some data in a tiny_db asset and whanna make a grid on the paper. I see this example code on the jspdf page, but do not know how to handle those “vectors” to pass to the ... More on community.appinventor.mit.edu
🌐 community.appinventor.mit.edu
0
January 20, 2020
How to style the table with jspdf
hi, I have a hard time to modify the style of my table that I want to be generated in pdf(I work with jspdf),this is my code: More on sitepoint.com
🌐 sitepoint.com
0
December 16, 2014
jsPDF - images with doc.table() method.
I think pdfMake is my answer. More on reddit.com
🌐 r/vuejs
2
2
September 10, 2020
Anyone with jsPDF experience? Having issue with resizing content to fit in single PDF, could use some guidance
I haven't used it but have you checked stack overflow? This post looks pretty promising: https://stackoverflow.com/questions/36472094/how-to-set-image-to-fit-width-of-the-page-using-jspdf More on reddit.com
🌐 r/Frontend
7
4
September 13, 2020
🌐
Medium
medium.com › @charkins.dev › build-a-custom-table-with-react-jspdf-7d43729f6d70
Build a custom table with React/jsPDF | by Cory Harkins | Medium
January 29, 2020 - We are setting the orientation to landscape, unit of measurement to point (jsPDF offers mm, in, and px as valid measurements), and the paper size format is a4 in this example. Now, we know that our paper size is A4, however, what does that really mean in context of our unit of measurement? We need to get the page dimensions in height and width based in Point sizes. In the source code here, there is a table that represents the [width, height] of each size paper available and because we are in landscape mode (see orientation in jsPDF config options above) I flipped the width and height values to reflect this in the pageDimensions object.
🌐
Phppot
phppot.com › javascript › jspdf-autotable
jsPDF AutoTable example – Table to PDF - Phppot
December 3, 2022 - PDF tables generation from HTML or JavaScript array using jsPDF AutoTables plugin.
🌐
CodePen
codepen.io › CJHARKINS › pen › JmjxvG
jsPDF table
const doc = new jsPDF({ orientation: "p", //set orientation unit: "pt", //set unit for document format: "letter" //set document standard }); const btn = document.querySelector("button"); const input = document.querySelector("input"); const data1 = 'Type/Type', data2 = 'asidghalwkghuahewlgauhlwegnva', status = 'STATUS', creator = 'James Dean', date = new Date(); const sizes = { xs: 10, sm : 14, p: 16, h3: 18, h2: 20, h1: 22 }; const fonts = { times: 'Times', helvetica: 'Helvetica' }; const margin = 0.5; // inches on a 8.5 x 11 inch sheet.
🌐
MIT App Inventor
community.appinventor.mit.edu › mit app inventor help
Generate a pdf table with the jspdf library - MIT App Inventor Help - MIT App Inventor Community
January 20, 2020 - i managed to make simple pdf pages with some text and images on the “page”, but now comes the hard thing. I stored some data in a tiny_db asset and whanna make a grid on the paper. I see this example code on the jspdf page, but do not know how to handle those “vectors” to pass to the pdf generation code … lists?: var generateData = function (amount) { var result = []; var data = { coin: "100", game_group: "GameGroup", game_name: "XPTO2", game_version: "25", machine: "20485...
🌐
Appsmith
community.appsmith.com › tutorial › data-driven-pdf-generator-jspdf-and-autotable
Data-Driven PDF Generator with JSPDF and Autotable | Appsmith Community Portal
October 12, 2024 - In this guide, we'll be using the JSPDF library and the JSPDF-AutoTable plug-in to generate PDFs from customer order data. This method builds a PDF programmatically, one line at a time, as opposed to other methods that use a template or HTML. Using this approach, you can input data from any Appsmith datasource, and transform it with JavaScript to generate a PDF from the live data.
Find elsewhere
🌐
Simonbengtsson
simonbengtsson.github.io › jsPDF-AutoTable
AutoTable sample
It appears you don't have PDF support in this web browser. Click here to download the PDF
🌐
npm
npmjs.com › package › jspdf-autotable
jspdf-autotable - npm
February 26, 2025 - --></table> autoTable(doc, { html: '#my-table' }) // Or use javascript directly: autoTable(doc, { head: [['Name', 'Email', 'Country']], body: [ ['David', '[email protected]', 'Sweden'], ['Castille', '[email protected]', 'Spain'], // ... ], }) doc.save('table.pdf') You can also use the plugin methods directly on the jsPDF documents:
      » npm install jspdf-autotable
    
Published   Feb 26, 2025
Version   5.0.2
Author   Simon Bengtsson
🌐
GitHub
github.com › JonatanPe › jsPDF-AutoTable
GitHub - JonatanPe/jsPDF-AutoTable
Check out the demo to get an overview of what can be done with this plugin. Example uses include participant tables, start lists, result lists etc. Download and include jspdf.plugin.autotable.js and jspdf.min.js.
Starred by 17 users
Forked by 4 users
Languages   TypeScript 81.5% | JavaScript 18.5%
🌐
cdnjs
cdnjs.com › home › libraries › jspdf-autotable
jspdf-autotable - Libraries - cdnjs - The #1 free and open source CDN built to make life easier for developers
Generate PDF tables with jsPDF - Simple. Fast. Reliable. Content delivery at its finest. cdnjs is a free and open-source CDN service trusted by over 12.5% of all websites, serving over 200 billion requests each month, powered by Cloudflare. We make it faster and easier to load library files on your websites.
🌐
YouTube
youtube.com › watch
How to Add Tables to PDF Document Using jsPdf Autotable ...
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
Published   February 4, 2020
🌐
jsDocs.io
jsdocs.io › package › jspdf-autotable
[email protected] - jsDocs.io
February 26, 2025 - Called after a cell has been added to the page. Can be used to draw additional cell content such as images with doc.addImage, additional text with doc.addText or other jspdf shapes.
🌐
npm
npmjs.com › package › jspdf-autotable › v › 3.0.0-alpha.3
AutoTable - Table plugin for jsPDF
August 7, 2018 - This jsPDF plugin aims at making it easy to generate pdf tables either from HTML or directly from Javascript.
      » npm install jspdf-autotable
    
Published   Feb 26, 2025
Version   3.0.0-alpha.3
Author   Simon Bengtsson
🌐
jsPDF
artskydj.github.io › jsPDF › docs › jsPDF.html
jsPDF - Documentation
One property is prepopulated. It is the 'events' Object. Plugin authors can add topics, callbacks to this object. These will be reassigned to all new instances of jsPDF.
🌐
SitePoint
sitepoint.com › javascript
How to style the table with jspdf
December 16, 2014 - function tableToJson(table) { var data = []; var headers = ["Référence","Nom","Prenom","Email","Adresse de Facturation"]; specialElementHandlers = { // element with id of "bypass" - jQuery style selector '#bypassme': function(element, renderer) { // true = "handled elsewhere, bypass text extraction" return true } } , margins = { top: 80, bottom: 60, left: 40, width: 522 }; data.push(headers); // go through cells for (var i=1; i<table.rows.length;i++) { var tableRow = table.rows[i]; var rowData = {}; for (var j=0; j<tableRow.cells.length,j<5 ; j++) { rowData[ headers[j] ] = tableRow.cells[j].
🌐
CodeSandbox
codesandbox.io › examples › package › jspdf-autotable
jspdf-autotable examples - CodeSandbox
AboutGenerate pdf tables with javascript (jsPDF plugin)1,104,014Weekly Downloads · Latest version5.0.2 · LicenseMIT · External Links · simonbengtsson.github.io/jsPDF-AutoTable · github.com/simonbengtsson/jsPDF-AutoTable · github.com/simonbengtsson/jsPDF-AutoTable/issues ·
🌐
TheoryApp
theoryapp.com › how-to-create-a-table-using-jspdf
How to Create a Table using jsPDF – TheoryApp
July 9, 2023 - By executing this code, a PDF document with a simple table will be generated and saved as “table.pdf”. The table will display the provided data with the specified columns and rows. You can modify the columns, rows, and table options to fit your specific requirements.
🌐
Medium
medium.com › @aalam-info-solutions-llp › creating-dynamic-pdfs-with-jspdf-and-customizing-autotables-in-react-a846a6f3fdca
Creating Dynamic PDFs with JsPDF and Customizing AutoTables in React | by Aalam Info Solutions LLP | Medium
March 6, 2024 - pdf.autoTable: This function is provided by the jsPDF-AutoTable library. It automatically generates a table based on the provided data and settings.