jsPDF-AutoTable points its download links at master and ships three dist names
jsPDF plugin for generating PDF tables with javascript
At a glance
- What is it?
- jsPDF-AutoTable is the MIT plugin that adds table rendering to jsPDF, from HTML or from JavaScript arrays. Its peer range accepts jsPDF 2, 3 and 4 while the dev build only ever installs 4, its download instructions point at a branch the repository no longer uses, and a `columns` option drops body cells without warning.
- Who is it for?
- jsPDF-AutoTable is a sensible choice when your table data already exists as HTML or as arrays, and the option surface is documented closely enough to configure it without reading the source. Two things are worth knowing before you ship a PDF built with it.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 108 days ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 10, 2026, and from our analysis. They are not legal advice.
Editorial analysis
The download instructions point at master while the default branch is main
The installation section offers three routes, and only one of them is versioned by anything the repository controls:
npm install jspdf jspdf-autotableThe other two are the jspdf download and the jspdf-autotable download, both pointing at `raw.githubusercontent.com/simonbengtsson/jsPDF-AutoTable/master/dist/`, and the examples link points at `github.com/simonbengtsson/jsPDF-AutoTable/tree/master/examples`. The repository's default branch is `main`. Anyone following those two links verbatim is asking a hosting service for a branch name the repository does not use as its default, so the npm route is the one to take. It is a small thing, and it is the kind of small thing that survives in a README for years because the URLs look correct when read.
Three dist filenames appear across the readme and the package manifest
The manifest names the build artifacts three ways. `main` is `dist/jspdf.plugin.autotable.js`, the `exports` map sends `require` to the same `.js` file and `import` to `dist/jspdf.plugin.autotable.mjs`, and the types condition points at `./dist/index.d.ts` while the top level `types` field says `dist/index` with no extension. The README adds a fourth reference by asking script-tag users to load `jspdf.plugin.autotable.min.js`. That minified name appears nowhere in the manifest, so whether it exists depends entirely on what the build leaves in `dist/`, and the published set is declared as `files: ["dist/*"]`. There is also a `./es` export subpath that offers only a `default` condition and no `require`, so a CommonJS caller has to go through the root entry.
The peer range spans jsPDF 2 to 4 and the dev build only ever installs 4
`peerDependencies` declares `"jspdf": "^2 || ^3 || ^4"`, so the plugin presents itself as working across three major versions of its host library. The development dependency above it pins `"jspdf": "^4.2.1"` and nothing else, and the test setup runs `vitest` against `happy-dom` in a single configured environment. In practice that means compatibility with jsPDF 2 and 3 is asserted by a version range rather than exercised by the build. That is a normal choice for a plugin, and it is also the line to check first if a table renders oddly under an older jsPDF: nothing in the repository would have caught it. The peer range is a promise; the dev dependency is the evidence, and only one of the two is testable.
Rollup, webpack and a type bundler all appear in one dev dependency list
The build tooling is plural in a way that is worth mapping. Webpack carries three packages plus `webpack-dev-server` and `ts-loader`, and the `start` script runs `webpack serve --config webpack.config.mjs --mode=development`. Rollup appears alongside `@rollup/plugin-typescript` and a separate `rollup.config.mjs` at the root, while `dts-bundle-generator` is there to produce the bundled type declarations. Four config files sit side by side: `webpack.config.mjs`, `rollup.config.mjs`, `vitest.config.mts` and `eslint.config.mjs`, plus `tsconfig.json`. Two compilers for the same TypeScript, one of which appears to be for the library build and the other for the demo, is a defensible arrangement but it doubles the places a version bump can go wrong.
Passing `columns` drops body cells that no column claims
The `columns` option takes a list of column definitions, either a header string or an object with `header` and `dataKey`. Once you supply it, that list becomes the table. The example that demonstrates it carries the warning in a comment: America will not be included even though it exists in the body, since there is no column specified for it. So a mismatch between the width of your data and the width of your column list produces a shorter table and no error. The same option changes how styles are keyed, because `columnStyles` normally indexes by column number and switches to `dataKey` once `columns` is used, and another comment in the styling examples repeats that the `0` should become the dataKey in that case.
lineWidth defaults to 0, so the striped theme ships without a border
The style defaults are where surprises live. `theme` accepts `striped`, `grid` and `plain` and defaults to `striped`, but `lineWidth` is documented as `border = 0` with the note that if it is 0 no border is drawn, and `lineColor` is a gray level of 10. A first table therefore gets alternating fills and no grid lines, which reads as a bug when you expected the `grid` look. `overflow` defaults to `linebreak`, so long cells wrap rather than truncate, and `useCss` defaults to false even though the plugin can parse HTML, which means styles from the page are ignored unless you ask for them. `showHead` repeats the header on every page by default, and `pageBreak` and `rowPageBreak` both take `avoid` to mean never split unless the table or row is taller than the page.
The release list skips v5.0.6 and the last push is dated 2026-06-24
The three most recent releases are v5.0.8 on 2026-05-17, v5.0.7 on 2026-01-04 and v5.0.5 on 2025-12-18. v5.0.6 is not among them, so the tag sequence in the recent window has a hole in it. The manifest version is 5.0.8, which does match the newest release, so there is no skew between the tree and the published package. The last push on the default branch is 2026-06-24, about three months before this writing, which means the tree is ahead of the newest release by a little over a month with no tag on it. The release gaps are uneven as well, four months between v5.0.5 and v5.0.7, then a five month gap to v5.0.8, so there is no cadence to plan upgrades around.
The documentation page is generated from one example file
The examples directory doubles as the documentation. `examples/examples.js` is described as the source code for the demo documents, so the site at the project homepage is built from the same file that holds the usage snippets. Alongside it sit `examples/nodejs.mjs` for the server-side case, `examples/simple.html`, and an `examples/assets/` folder, with an `index.html` and a `samples.png` at the repository root. That arrangement means the examples are documentation, tests and demo in one place, which is why the options are described as being used in the examples. It also means a broken example is a broken page, so the demo site is a reasonable smoke test before blaming the plugin.
Editorial conclusion
jsPDF-AutoTable is a sensible choice when your table data already exists as HTML or as arrays, and the option surface is documented closely enough to configure it without reading the source. Two things are worth knowing before you ship a PDF built with it. The peer range is wider than the tested range, so if you are still on jsPDF 2 or 3 you are outside what the dev dependency ever exercised. And the silent defaults will shape your output: `lineWidth` is 0, so no border is drawn at all until you set one, and passing `columns` discards body cells that no column claims. Everything is overridable, but nothing warns you when you got it wrong.
Frequently asked questions
how to install jspdf autotable
Three routes are offered: `npm install jspdf jspdf-autotable`, downloading the two dist files from GitHub, or loading them from a CDN such as unpkg. The package publishes only `dist/*`, and its peer dependency accepts jsPDF `^2 || ^3 || ^4`.
what is jspdf autotable
A plugin for jsPDF that adds table generation to a PDF document, either by parsing an HTML table given as a CSS selector or by passing JavaScript arrays as `head`, `body` and `foot`. It is MIT licensed, and the only required option is either `html` or `body`.
how to use jspdf autotable
There are three usage modes: the named `autoTable(doc, options)` export, `applyPlugin(jsPDF)` followed by `doc.autoTable(...)`, and plain script tags that load `jspdf.min.js` and then `jspdf.plugin.autotable.min.js` before calling `doc.autoTable`.
jspdf autotable is not a function
That error comes from the usage mode rather than from the package. `doc.autoTable` exists only after `applyPlugin(jsPDF)` has run, or after the plugin script has been loaded in a script-tag page. With the ES module build you call the named `autoTable` export directly as `autoTable(doc, options)`.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/simonbengtsson-jspdf-autotable)