npm
npmjs.com › package › jspdf-autotable
jspdf-autotable - npm
This jsPDF plugin adds the ability to generate PDF tables either by parsing HTML tables or by using Javascript data directly. Check out the demo or examples. Get jsPDF and this plugin by doing one of these things: ... import { jsPDF } from 'jspdf' import { autoTable } from 'jspdf-autotable' const doc = new jsPDF() // It can parse html: // <table id="my-table"><!-- ...
» npm install jspdf-autotable
Published Feb 26, 2025
Version 5.0.2
Author Simon Bengtsson
Videos
07:19
jsPDF-Autotable Tutorial to Insert Array of JSON Objects Data ...
12:28
jsPDF-Autotable Project to Add Images inside Table Rows ...
05:36
jsPDF-Autotable Tutorial To Add Colorful Border to Header ...
14:12
jsPDF-Autotable Tutorial to Add Dynamic Nested HTML5 ...
23:13
Next.js jsPDF-Autotable Example to Insert JSON API Data Info ...
jsPDF-Autotable Tutorial to Add Dynamic Tables in PDF ...
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
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%
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.
GitHub
github.com › simonbengtsson › jsPDF-AutoTable
GitHub - simonbengtsson/jsPDF-AutoTable: jsPDF plugin for generating PDF tables with javascript
This jsPDF plugin adds the ability to generate PDF tables either by parsing HTML tables or by using Javascript data directly. Check out the demo or examples. Get jsPDF and this plugin by doing one of these things: ... import { jsPDF } from 'jspdf' import { autoTable } from 'jspdf-autotable' const doc = new jsPDF() // It can parse html: // <table id="my-table"><!-- ...
Starred by 2.5K users
Forked by 637 users
Languages TypeScript 89.5% | HTML 7.6% | JavaScript 2.9%
GitHub
github.com › simonbengtsson › jsPDF-AutoTable › blob › master › examples › simple.html
jsPDF-AutoTable/examples/simple.html at master · simonbengtsson/jsPDF-AutoTable
jsPDF plugin for generating PDF tables with javascript - jsPDF-AutoTable/examples/simple.html at master · simonbengtsson/jsPDF-AutoTable
Author simonbengtsson
JSFiddle
jsfiddle.net › lsimpson › yrk2ofxt › 83
jspdf-autotable example - JSFiddle - Code Playground
The Code Completion will now also have the context of all panels before suggesting code to you - so if for example you have some CSS or JS, the HTML panel will suggest code based on the other two panels.
GitHub
github.com › simonbengtsson › jsPDF-AutoTable › blob › a35c7a2c18ba4a8f10a7fb420335c05b8824524a › examples › examples.js
jsPDF-AutoTable/examples/examples.js at a35c7a2c18ba4a8f10a7fb420335c05b8824524a · simonbengtsson/jsPDF-AutoTable
// You can also use this to draw other custom jspdf content to cells with doc.text or doc.rect ... if ((data.row.section === 'head' || data.row.section === 'foot') && data.column.dataKey === "expenses" && coinBase64Img) { doc.addImage(coinBase64Img, 'PNG', data.cell.x + 5, data.cell.y + 2, 5, 5); ... // Use this to add content to each page that has the autoTable on it. This can be page headers, // page footers and page numbers for example.
Author simonbengtsson
GitHub
github.com › simonbengtsson › jsPDF-AutoTable › tree › master › examples
jsPDF-AutoTable/examples at master · simonbengtsson/jsPDF-AutoTable
jsPDF plugin for generating PDF tables with javascript - jsPDF-AutoTable/examples at master · simonbengtsson/jsPDF-AutoTable
Author simonbengtsson
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
CloudDefense.ai
clouddefense.ai › code › javascript › example › jspdf
Top 10 Examples of jspdf code in Javascript
this.previousAutoTable = table; this.lastAutoTable = table; this.autoTable.previous = table; // Deprecated applyUserStyles(); resetState(); return this; } jsPDF.API.autoTable = autoTable; // Assign false to enable `doc.lastAutoTable.finalY || 40` sugar; jsPDF.API.lastAutoTable = false; ...
jsDocs.io
jsdocs.io › package › jspdf-autotable
[email protected] - jsDocs.io
type autoTableInstanceType = (options: UserOptions) => void; type CellHook = (data: CellHookData) => void | boolean; type CellInput = null | string | string[] | number | boolean | CellDef; ... No dependencies.
UNPKG
unpkg.com › [email protected] › README.md
Unpkg
``` Or if using javascript modules and es6: ```js import jsPDF from 'jspdf'; import 'jspdf-autotable'; const doc = new jsPDF(); doc.autoTable({html: '#my-table'}); doc.save('table.pdf'); ``` Checkout more examples in [examples.js](examples) which is also the source code for the [demo](https://simonbengtsson.github.io/jsPDF-AutoTable/) documents.
GitHub
github.com › simonbengtsson › jsPDF-AutoTable › blob › master › examples › examples.js
jsPDF-AutoTable/examples/examples.js at master · simonbengtsson/jsPDF-AutoTable
jsPDF plugin for generating PDF tables with javascript - jsPDF-AutoTable/examples/examples.js at master · simonbengtsson/jsPDF-AutoTable
Author simonbengtsson
CodePen
codepen.io › someatoms › pen › adojWy
Two tables and header with jspdf-autotable
function generate() { var doc = new jsPDF('p', 'pt'); var res = doc.autoTableHtmlToJson(document.getElementById("basic-table")); doc.autoTable(res.columns, res.data, {margin: {top: 80}}); var header = function(data) { doc.setFontSize(18); doc.setTextColor(40); doc.setFontStyle('normal'); //doc.addImage(headerImgData, 'JPEG', data.settings.margin.left, 20, 50, 50); doc.text("Testing Report", data.settings.margin.left, 50); }; var options = { beforePageContent: header, margin: { top: 80 }, startY: doc.autoTableEndPosY() + 20 }; doc.autoTable(res.columns, res.data, options); doc.save("table.pdf"); }
Top answer 1 of 2
7
Try the below code to give the styles to cells of particular row.
doc.autoTable({
html: '#table',
didParseCell(data) {
if (data.cell.row.index === 0) {
data.cell.styles.textColor = [255, 255, 255];
data.cell.styles.fillColor = '#FF5783';
}
}
})
2 of 2
-2
Try this :
$(document).ready(function()
{
$('tr').find('td').eq(0).addClass('highlight');
});
Example : https://jsfiddle.net/bneen5rc/