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
To see what is included in the Table, Row, Column and Cell types, either log them to the console or take a look at src/models.ts · // Example with an image drawn in each cell in the first column autoTable(doc, { didDrawCell: (data) => { if (data.section === 'body' && data.column.index === 0) { const base64Img = 'data:image/jpeg;base64,iVBORw0KGgoAAAANS...' doc.addImage(base64Img, 'JPEG', data.cell.x + 2, data.cell.y + 2, 10, 10) } }, }) ... jsPDF.autoTableSetDefaults({ /* ...
Starred by 2.5K users
Forked by 637 users
Languages   TypeScript 89.5% | HTML 7.6% | JavaScript 2.9%
🌐
Phppot
phppot.com › javascript › jspdf-autotable
jsPDF AutoTable example – Table to PDF - Phppot
PDF tables generation from HTML or JavaScript array using jsPDF AutoTables plugin.
🌐
CodePen
codepen.io › CJHARKINS › pen › JmjxvG
jsPDF table
const verticalOffset = margin; var columns = [ {title: "COL1", dataKey: "col1"}, {title: "COL2", dataKey: "col2"}, {title: "COL3", dataKey: "col3"}, {title: "COL4", dataKey: "col4"} ]; var rows = [ { "col1": status, "col2": `${data1}\n${data2}`, "col3": creator, "col4": date.getUTCDate() }, { "col1": "data-cell_r2_c1", "col2": "data-cell_r2_c2", "col3": "data-cell3_r2_c3", "col4": "data-cell4_r2_c4" }, { "col1": "data-cell_r3_c1", "col2": "data-cell_r3_c2", "col3": "data-cell3_r3_c3", "col4": "data-cell4_r3_c4" } ]; btn.addEventListener("click", () => { const name = input.value; doc.autoTable(
🌐
npm
npmjs.com › package › jspdf-autotable
jspdf-autotable - npm
To see what is included in the Table, Row, Column and Cell types, either log them to the console or take a look at src/models.ts · // Example with an image drawn in each cell in the first column autoTable(doc, { didDrawCell: (data) => { if (data.section === 'body' && data.column.index === 0) { const base64Img = 'data:image/jpeg;base64,iVBORw0KGgoAAAANS...' doc.addImage(base64Img, 'JPEG', data.cell.x + 2, data.cell.y + 2, 10, 10) } }, }) ... jsPDF.autoTableSetDefaults({ /* ...
      » npm install jspdf-autotable
    
Published   Feb 26, 2025
Version   5.0.2
Author   Simon Bengtsson
🌐
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...
🌐
YouTube
youtube.com › watch
How to Add Tables to PDF Document Using jsPdf Autotable Library in Javascript - YouTube
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
🌐
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 - Build a custom table with React/jsPDF TL;DR: Project files here Hello, and welcome to my blog tutorial on how to create a custom table and export it using jsPDF! This tutorial aims to give you a …
Find elsewhere
🌐
Plunker
embed.plnkr.co › enTDfltWHNZ6NjjCjkSA
jsPDF table example - Plunker
: [1683.78, 2383.94], 'a2' : [1190.55, 1683.78], 'a3' : [ 841.89, 1190.55], 'a4' : [ 595.28, 841.89], 'a5' : [ 419.53, 595.28], 'a6' : [ 297.64, 419.53], 'a7' : [ 209.76, 297.64], 'a8' : [ 147.40, 209.76], 'a9' : [ 104.88, 147.40], 'a10' : [ 73.70, 104.88], 'b0' : [2834.65, 4008.19], 'b1' : [2004.09, 2834.65], 'b2' : [1417.32, 2004.09], 'b3' : [1000.63, 1417.32], 'b4' : [ 708.66, 1000.63], 'b5' : [ 498.90, 708.66], 'b6' : [ 354.33, 498.90], 'b7' : [ 249.45, 354.33], 'b8' : [ 175.75, 249.45], 'b9' : [ 124.72, 175.75], 'b10' : [ 87.87, 124.72], 'c0' : [2599.37, 3676.54], 'c1' : [1836.85, 2599.37
🌐
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 - For more info on styling the table, check out the examples here. Lastly, add a header and footer using the customer data. Update the function with: export default { buildPdf(order = SampleData.orders[0]) { const doc = new jspdf.jsPDF(); // Add Header const addHeader = () => { doc.setFontSize(18); doc.text(`Order #${order.order_id}`, 14, 15); // Order number doc.setFontSize(12); doc.text(`Customer: ${order.customer.name}`, 14, 25); doc.text(`Email: ${order.customer.email}`, 14, 32); doc.text(`Address: ${order.customer.address.street}, ${order.customer.address.city}, ${order.customer.address.sta
🌐
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
🌐
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. To add the jspdf-autotable ...
🌐
SitePoint
sitepoint.com › javascript
How to style the table with jspdf
December 16, 2014 - 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: 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 extra...
🌐
JSFiddle
jsfiddle.net › ugD5L › 135
Export HTML Table to PDF using jsPDF - JSFiddle - Code Playground
The fiddle listings (Public, Private, Titled, etc) will now display latest versions instead of the ones saved as Base versions - this was causing more confusion than good, so we decided to change this long-standing behavior.
🌐
CSS Script
cssscript.com › home › categories › table › generate professional & beautiful pdf tables with jspdf-table
Generate Professional & Beautiful PDF Tables with jsPDF-Table | CSS Script
July 31, 2025 - Page Breaks: Automatically adds ... table headers for readability. Flexible Layouts: Multiple modes for calculating column widths, including auto, equal, and content. Error Handling: Provides specific error classes for validation and rendering issues. 1. Install both jspdf and jspdf-table ...
🌐
CodeSandbox
codesandbox.io › examples › package › jspdf-autotable
jspdf-autotable examples - CodeSandbox
Use this online jspdf-autotable playground to view and fork jspdf-autotable example apps and templates on CodeSandbox.
🌐
CloudDefense.ai
clouddefense.ai › code › javascript › example › jspdf
Top 10 Examples of jspdf code in Javascript
// Assign false to enable `doc.lastAutoTable.finalY || 40` sugar; jsPDF.API.lastAutoTable = false; jsPDF.API.previousAutoTable = false; // deprecated in v3 jsPDF.API.autoTable.previous = false; // deprecated in v3 jsPDF.API.autoTableSetDefaults = function(defaults) { setDefaults(defaults, this); return this; }; jsPDF.autoTableSetDefaults = function(defaults, doc) { setDefaults(defaults, doc); return this; }; jsPDF.API.autoTableHtmlToJson = function(tableElem, includeHiddenElements) { includeHiddenElements = includeHiddenElements || false; if (!tableElem || !(tableElem instanceof HTMLTableElement)) { console.error("A HTMLTableElement has to be sent to autoTableHtmlToJson"); return null; } let {head, body, foot} = parseHtml(tableElem, includeHiddenElements, false); let firstRow = head[0] || body[0] || foot[0]; return {columns: firstRow, rows: body, data: body}; }; /** * @deprecated */
🌐
C# Corner
c-sharpcorner.com › article › export-an-html-table-using-jspdf-autotable
Export An HTML Table To PDF Using jsPDF - Autotable
October 4, 2020 - I have created a simple table that contains a list of students with their marks. Copy and Paste the following code. If you wish to design your own HTML table, you can do that as well. <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.min.js"></script>
🌐
UNPKG
unpkg.com [email protected] › README.md
Unpkg
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: ```js import jsPDF from 'jspdf' import 'jspdf-autotable' const doc = new jsPDF() doc.autoTable({ html: '#my-table' }) doc.save('table.pdf') ``` The third usage option is with downloaded or CDN dist files ```html ``` Checkout more examples in [examples.js](examples) which is also the source code for the [demo](https://simonbengtsson.github.io/jsPDF-AutoTable/) documents. ## Options Below is a list of all options supported in the plugin.