github simonbengtsson/jsPDF-AutoTable v3.0.0

latest releases: v3.8.2, v3.8.1, v3.8.0...
5 years ago

BREAKING

The hooks API has been simplified. Note that colspans and rowspans now is supported so you can use that instead of the old drawCell hack.

  • Removed hooks: createdCell, createdHeaderCell, drawHeaderCell, drawCell, drawRow, drawHeaderRow and addPageContent
  • Added hooks: didParseCell, willDrawCell, didDrawCell and didDrawPage

All other changes should be backwards compatible, but it's a rewrite of the plugin so file an issue if you encounter something that did not work as expected after upgrading.

Migrating

Migrating to version 3.0 should be rather painless as most changes are backwards compatible. Everything was pretty much rewritten however so open an issue if you encounter any problems!

The removed hooks can be replaced as follows:

  • drawCell, drawRow and similar → didDrawCell with potensial checks to only draw things if on the wanted section (head, body or foot)
  • createdCell → didParseCell
  • addPageContent → didDrawPage

Changelog

  • BREAKING: Old hooks with new ones (See above)
  • BREAKING: No longer supports 0.9.x of jsPDF
  • BREAKING: Now targets ES5 (no longer supports <=IE8)
  • Added native rowspan and colspan support
  • Added multiple header rows support
  • Added footer rows support
  • Added html initialization with html: string|HTMLTableElement. If set to string it should be a css selector pointing to a table element.
  • Added useCss: boolean for using some basic css styles when table initialized from html
  • Added includeHiddenHtml: boolean option
  • Added showFooter option (similar to showHeader)
  • Added footerStyles option (similar to headerStyles)
  • Added rowPageBreak option
  • Added text align justify (with the style halign: 'justify'
  • Added automatic startY when multiple tables are used
  • Changed initialization to doc.autoTable({head: ..., body: ... foot: ..., columns: ...})
  • Changed getting last autoTable instance from doc.autoTable.previous to doc.lastAutoTable
  • Changed default overflow method to linebreak (previously it was ellipsize)
  • Changed rowHeight style to cellHeight
  • Changed columnWidth style to cellWidth
  • Changed and simplified hooks to `didParseCell, willDrawCell, didDrawCell, didDrawPage
  • Deprecated the old initialization doc.autoTable(columns, data, options)
  • Deprecated autoTableHtmlToJson() in favour of new html option
  • Deprecated old way of getting previous autoTable instance doc.autoTable.previous

Don't miss a new jsPDF-AutoTable release

NewReleases is sending notifications on new releases.