{"id":19898395,"url":"https://github.com/natancabral/pdfkit-table","last_synced_at":"2025-04-05T02:07:27.708Z","repository":{"id":37852579,"uuid":"378266202","full_name":"natancabral/pdfkit-table","owner":"natancabral","description":" Helps to draw informations in simple tables using pdfkit. #server-side. Generate pdf tables with javascript (PDFKIT plugin) ","archived":false,"fork":false,"pushed_at":"2024-02-17T19:55:12.000Z","size":12105,"stargazers_count":99,"open_issues_count":55,"forks_count":64,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-29T01:04:51.317Z","etag":null,"topics":["javascript","json","nodejs","pdf","pdf-table","pdfkit","pdfkit-table","server-side"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/natancabral.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-18T21:15:05.000Z","updated_at":"2025-03-13T23:01:27.000Z","dependencies_parsed_at":"2024-06-18T13:56:30.197Z","dependency_job_id":"a5308a6e-9250-4e2f-8728-74c5c1224087","html_url":"https://github.com/natancabral/pdfkit-table","commit_stats":{"total_commits":148,"total_committers":6,"mean_commits":"24.666666666666668","dds":"0.20270270270270274","last_synced_commit":"707a1917d6f628ddc12b72c7010a1b25d108030f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natancabral%2Fpdfkit-table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natancabral%2Fpdfkit-table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natancabral%2Fpdfkit-table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natancabral%2Fpdfkit-table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/natancabral","download_url":"https://codeload.github.com/natancabral/pdfkit-table/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276163,"owners_count":20912288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","json","nodejs","pdf","pdf-table","pdfkit","pdfkit-table","server-side"],"created_at":"2024-11-12T19:04:14.733Z","updated_at":"2025-04-05T02:07:22.782Z","avatar_url":"https://github.com/natancabral.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n  \u003cimg src=\"https://github.com/natancabral/pdfkit-table/blob/main/example/logo.png\" alt=\"pdfkit-table (Natan Cabral)\"/\u003e\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n\u003c/p\u003e\n\n# pdfkit-table\n\n#### Generate pdf tables with javascript (PDFKIT plugin)\nHelps to draw informations in simple tables using pdfkit. #server-side.\n\n\n## Examples\n\n[view pdf example](https://github.com/natancabral/pdfkit-table/raw/main/example/document.pdf) | \n[color pdf](https://github.com/natancabral/pdfkit-table/raw/main/example/document-color.pdf) | \n[full code example](https://github.com/natancabral/pdfkit-table/blob/main/example/index-example.js) |\n[server example](https://github.com/natancabral/pdfkit-table/blob/main/example/index-server-example.js) |\n[json example](https://github.com/natancabral/pdfkit-table/blob/main/example/index-json-example.js) |\n[all](https://github.com/natancabral/pdfkit-table/blob/main/example/)\n\n\u003cimg src=\"https://github.com/natancabral/pdfkit-table/blob/main/example/pdf-sample.png\"/\u003e\n\n## Install [\u003cimg src=\"https://github.com/natancabral/pdfkit-table/blob/main/example/npm-tile.png\"\u003e](https://www.npmjs.com/package/pdfkit-table)\n\n[![NPM](https://nodei.co/npm/pdfkit-table.png)](https://www.npmjs.com/package/pdfkit-table)\n\n```bash\nnpm install pdfkit-table\n```\n\n## Use\n\n```js\n  // requires\n  const fs = require(\"fs\");\n  const PDFDocument = require(\"pdfkit-table\");\n\n  // init document\n  let doc = new PDFDocument({ margin: 30, size: 'A4' });\n  // save document\n  doc.pipe(fs.createWriteStream(\"./document.pdf\"));\n  \n  ;(async function createTable(){\n    // table\n    const table = { \n      title: '',\n      headers: [],\n      datas: [ /* complex data */ ],\n      rows: [ /* or simple data */ ],\n    };\n\n    // the magic (async/await)\n    await doc.table(table, { /* options */ });\n    // -- or --\n    // doc.table(table).then(() =\u003e { doc.end() }).catch((err) =\u003e { })\n\n    // if your run express.js server\n    // to show PDF on navigator\n    // doc.pipe(res);\n\n    // done!\n    doc.end();\n  })();\n\n```\n\n## Examples\n\n### Server response\n[server example](https://github.com/natancabral/pdfkit-table/blob/main/example/index-server-example.js)\n```js\n  // router - Node + Express.js\n  app.get('/create-pdf', async (req, res) =\u003e {\n    // ...await table code\n    // if your run express.js server\n    // to show PDF on navigator\n    doc.pipe(res);\n    // done!\n    doc.end();\n  });\n```\n\n### Example 1 - Simple Array\n```js\n  ;(async function(){\n    // table \n    const table = {\n      title: \"Title\",\n      subtitle: \"Subtitle\",\n      headers: [ \"Country\", \"Conversion rate\", \"Trend\" ],\n      rows: [\n        [ \"Switzerland\", \"12%\", \"+1.12%\" ],\n        [ \"France\", \"67%\", \"-0.98%\" ],\n        [ \"England\", \"33%\", \"+4.44%\" ],\n      ],\n    };\n    // A4 595.28 x 841.89 (portrait) (about width sizes)\n    // width\n    await doc.table(table, { \n      width: 300,\n    });\n    // or columnsSize\n    await doc.table(table, { \n      columnsSize: [ 200, 100, 100 ],\n    });\n    // done!\n    doc.end();\n  })();\n```\n\n\n### Example 2 - Table\n```js\n  ;(async function(){\n    // table\n    const table = {\n      title: \"Title\",\n      subtitle: \"Subtitle\",\n      headers: [\n        { label: \"Name\", property: 'name', width: 60, renderer: null },\n        { label: \"Description\", property: 'description', width: 150, renderer: null }, \n        { label: \"Price 1\", property: 'price1', width: 100, renderer: null }, \n        { label: \"Price 2\", property: 'price2', width: 100, renderer: null }, \n        { label: \"Price 3\", property: 'price3', width: 80, renderer: null }, \n        { label: \"Price 4\", property: 'price4', width: 43, \n          renderer: (value, indexColumn, indexRow, row, rectRow, rectCell) =\u003e { return `U$ ${Number(value).toFixed(2)}` } \n        },\n      ],\n      // complex data\n      datas: [\n        { \n          name: 'Name 1', \n          description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean mattis ante in laoreet egestas. ', \n          price1: '$1', \n          price3: '$ 3', \n          price2: '$2', \n          price4: '4', \n        },\n        { \n          options: { fontSize: 10, separation: true},\n          name: 'bold:Name 2', \n          description: 'bold:Lorem ipsum dolor.', \n          price1: 'bold:$1', \n          price3: { \n            label: 'PRICE $3', options: { fontSize: 12 } \n          }, \n          price2: '$2', \n          price4: '4', \n        },\n        // {...},\n      ],\n      // simeple data\n      rows: [\n        [\n          \"Apple\",\n          \"Nullam ut facilisis mi. Nunc dignissim ex ac vulputate facilisis.\",\n          \"$ 105,99\",\n          \"$ 105,99\",\n          \"$ 105,99\",\n          \"105.99\",\n        ],\n        // [...],\n      ],\n    };\n    // the magic\n    doc.table(table, {\n      prepareHeader: () =\u003e doc.font(\"Helvetica-Bold\").fontSize(8),\n      prepareRow: (row, indexColumn, indexRow, rectRow, rectCell) =\u003e {\n        doc.font(\"Helvetica\").fontSize(8);\n        indexColumn === 0 \u0026\u0026 doc.addBackground(rectRow, 'blue', 0.15);\n      },\n    });\n    // done!\n    doc.end();\n  })();\n\n```\n\n### Example 3 - Json\n\n```js\n  ;(async function(){\n    // renderer function inside json file\n    const tableJson = '{ \n      \"headers\": [\n        { \"label\":\"Name\", \"property\":\"name\", \"width\":100 },\n        { \"label\":\"Age\", \"property\":\"age\", \"width\":100 },\n        { \"label\":\"Year\", \"property\":\"year\", \"width\":100 }\n      ],\n      \"datas\": [\n        { \"name\":\"bold:Name 1\", \"age\":\"Age 1\", \"year\":\"Year 1\" },\n        { \"name\":\"Name 2\", \"age\":\"Age 2\", \"year\":\"Year 2\" },\n        { \"name\":\"Name 3\", \"age\":\"Age 3\", \"year\":\"Year 3\",\n          \"renderer\": \"function(value, i, irow){ return value + `(${(1+irow)})`; }\"\n        }\n      ],\n      \"rows\": [\n        [ \"Name 4\", \"Age 4\", \"Year 4\" ]\n      ],\n      \"options\": {\n        \"width\": 300\n      }\n    }';\n    // the magic\n    doc.table(tableJson);\n    // done!\n    doc.end();\n  })();\n```\n\n### Example 4 - Json file (many tables)\n\n```js\n  ;(async function(){\n    // json file\n    const json = require('./table.json');\n    // if json file is array\n    Array.isArray(json) ? \n    // any tables - array\n    await doc.tables(json) : \n    // one table - string\n    await doc.table(json) ;\n    // done!\n    doc.end();\n  })();\n```\n\n## Table\n\n- \u003ccode\u003eArray.\u0026lt;object\u0026gt;\u003c/code\u003e | \u003ccode\u003eJSON\u003c/code\u003e\n  - headers \u003ccode\u003eArray.\u0026lt;object\u0026gt;\u003c/code\u003e | \u003ccode\u003eArray.[]\u003c/code\u003e\n    - label \u003ccode\u003eString\u003c/code\u003e\n    - property \u003ccode\u003eString\u003c/code\u003e\n    - width \u003ccode\u003eNumber\u003c/code\u003e\n    - align \u003ccode\u003eString\u003c/code\u003e\n    - valign \u003ccode\u003eString\u003c/code\u003e\n    - headerColor \u003ccode\u003eString\u003c/code\u003e\n    - headerOpacity \u003ccode\u003eNumber\u003c/code\u003e\n    - headerAlign \u003ccode\u003eString\u003c/code\u003e\n    - columnColor or ~~backgroundColor~~: \u003ccode\u003eString\u003c/code\u003e\n    - columnOpacity or ~~backgroundOpacity~~: \u003ccode\u003eNumber\u003c/code\u003e\n    - renderer \u003ccode\u003eFunction\u003c/code\u003e function( value, indexColumn, indexRow, row, rectRow, rectCell ) { return value }\n  - datas \u003ccode\u003eArray.\u0026lt;object\u0026gt;\u003c/code\u003e\n  - rows \u003ccode\u003eArray.[]\u003c/code\u003e\n  - title \u003ccode\u003eString\u003c/code\u003e | \u003ccode\u003eObject\u003c/code\u003e\n  - subtitle \u003ccode\u003eString\u003c/code\u003e | \u003ccode\u003eObject\u003c/code\u003e\n\n### Headers\n\n| Properties           | Type                  | Default            | Description       |\n-----------------------|-----------------------|--------------------|-------------------|\n| **label**            | \u003ccode\u003eString\u003c/code\u003e   | undefined          | description       |\n| **property**         | \u003ccode\u003eString\u003c/code\u003e   | undefined          | id                |\n| **width**            | \u003ccode\u003eNumber\u003c/code\u003e   | undefined          | width of column   |\n| **align**            | \u003ccode\u003eString\u003c/code\u003e   | left               | alignment         |\n| **valign**           | \u003ccode\u003eString\u003c/code\u003e   | undefined          | vertical alignment. ex: valign: \"center\"|\n| **headerColor**      | \u003ccode\u003eString\u003c/code\u003e   | grey or #BEBEBE    | color of header   |\n| **headerOpacity**    | \u003ccode\u003eNumber\u003c/code\u003e   | 0.5                | opacity of header |\n| **headerAlign**      | \u003ccode\u003eString\u003c/code\u003e   | left               | only header       |\n| **columnColor** or ~~backgroundColor~~  | \u003ccode\u003eString\u003c/code\u003e   | undefined          | color of column   |\n| **columnOpacity** or ~~backgroundOpacity~~| \u003ccode\u003eNumber\u003c/code\u003e   | undefined          | opacity of column   |\n| **renderer**         | \u003ccode\u003eFunction\u003c/code\u003e | Function           | function( value, indexColumn, indexRow, row, rectRow, rectCell ) { return value } |\n\n\n#### Simple headers example\n\n```js\nconst table = {\n  // simple headers only with ROWS (not DATAS)  \n  headers: ['Name', 'Age'],\n  // simple content\n  rows: [\n    ['Jack', '32'], // row 1\n    ['Maria', '30'], // row 2\n  ]\n};\n```\n\n#### Complex headers example\n\n```js\nconst table = {\n  // complex headers work with ROWS and DATAS  \n  headers: [\n    { label:\"Name\", property: 'name', width: 100, renderer: null },\n    { label:\"Age\", property: 'age', width: 100, renderer: (value) =\u003e `U$ ${Number(value).toFixed(1)}` },\n  ],\n  // complex content\n  datas: [\n    { name: 'bold:Jack', age: 32, },\n    // age is object value with style options\n    { name: 'Maria', age: { label: 30 , options: { fontSize: 12 }}, },\n  ],\n  // simple content (works fine!)\n  rows: [\n    ['Jack', '32'], // row 1\n    ['Maria', '30'], // row 2\n  ]\n};\n\n```\n\n### Options\n\n| Properties           | Type                  | Default            | Description       |\n-----------------------|-----------------------|--------------------|-------------------|\n| **title**            | \u003ccode\u003eString\u003c/code\u003e \u003ccode\u003eObject\u003c/code\u003e  | undefined          | title             |\n| **subtitle**         | \u003ccode\u003eString\u003c/code\u003e \u003ccode\u003eObject\u003c/code\u003e  | undefined          | subtitle          |\n| **width**            | \u003ccode\u003eNumber\u003c/code\u003e   | undefined          | width of table    |\n| **x**                | \u003ccode\u003eNumber\u003c/code\u003e   | undefined  | position x (left). To reset x position set \"x: null\" |\n| **y**                | \u003ccode\u003eNumber\u003c/code\u003e   | undefined  | position y (top)  |\n| **divider**          | \u003ccode\u003eObject\u003c/code\u003e   | undefined          | define divider lines |\n| **columnsSize**      | \u003ccode\u003eArray\u003c/code\u003e    | undefined          | define sizes      |\n| **columnSpacing**    | \u003ccode\u003eNumber\u003c/code\u003e   | 5                  |                   |\n| **padding**    | \u003ccode\u003eNumber\u003c/code\u003e \u003ccode\u003eArray\u003c/code\u003e   | 1 or [1, 5]                   |                   |\n| **addPage**          | \u003ccode\u003eBoolean\u003c/code\u003e  | false              | add table on new page |\n| **hideHeader**       | \u003ccode\u003eBoolean\u003c/code\u003e  | false              | hide header |\n| **minRowHeight**     | \u003ccode\u003eNumber\u003c/code\u003e  | 0              | min row height |\n| **prepareHeader**    | \u003ccode\u003eFunction\u003c/code\u003e | Function           | ()                  |\n| **prepareRow**       | \u003ccode\u003eFunction\u003c/code\u003e | Function           | (row, indexColumn, indexRow, rectRow, rectCell) =\u003e {} |\n\n#### Options example\n\n```js\nconst options = {\n  // properties\n  title: \"Title\", // { label: 'Title', fontSize: 30, color: 'blue', fontFamily: \"./fonts/type.ttf\" },\n  subtitle: \"Subtitle\", // { label: 'Subtitle', fontSize: 20, color: 'green', fontFamily: \"./fonts/type.ttf\" },\n  width: 500, // {Number} default: undefined // A4 595.28 x 841.89 (portrait) (about width sizes)\n  x: 0, // {Number} default: undefined | To reset x position set \"x: null\"\n  y: 0, // {Number} default: undefined | \n  divider: {\n    header: { disabled: false, width: 2, opacity: 1 },\n    horizontal: { disabled: false, width: 0.5, opacity: 0.5 },\n  },\n  padding: 5, // {Number} default: 0\n  columnSpacing: 5, // {Number} default: 5\n  hideHeader: false, \n  minRowHeight: 0,\n  // functions\n  prepareHeader: () =\u003e doc.font(\"Helvetica-Bold\").fontSize(8), // {Function} \n  prepareRow: (row, indexColumn, indexRow, rectRow, rectCell) =\u003e doc.font(\"Helvetica\").fontSize(8), // {Function} \n}\n```\n\n#### Options Row\n\n- separation \u003ccode\u003e{Booleon}\u003c/code\u003e\n- fontSize \u003ccode\u003e{Number}\u003c/code\u003e\n- fontFamily \u003ccode\u003e{String}\u003c/code\u003e\n\n```js\ndatas: [\n  // options row\n  { name: 'Jack', options: { fontSize: 10, fontFamily: 'Courier-Bold', separation: true } },\n]\n``` \n\n- String\n  - **bold:** \n    - 'bold:Jack'\n  - **size{n}:** \n    - 'size11:Jack'\n    - 'size20:Jack'\n\n```js\ndatas: [\n  // bold\n  { name: 'bold:Jack' },\n  // size{n}\n  { name: 'size20:Maria' },\n  { name: 'size8:Will' },\n  // normal\n  { name: 'San' },\n]\n``` \n\n#### Options Cell\n\n- fontSize \u003ccode\u003e{Number}\u003c/code\u003e\n- fontFamily \u003ccode\u003e{String}\u003c/code\u003e\n\n```js\ndatas: [\n  // options cell | value is object | label is string\n  { name: { label: 'Jack', options: { fontSize: 10, fontFamily: 'Courier-Bold' } },\n]\n``` \n\n#### Fonts Family\n\n- Courier\n  - Courier-Bold\n  - Courier-Oblique\n  - Courier-BoldOblique\n- Helvetica\n  - Helvetica-Bold\n  - Helvetica-Oblique\n  - Helvetica-BoldOblique\n- Symbol\n- Times-Roman\n  - Times-Bold\n  - Times-Italic\n  - Times-BoldItalic\n- ZapfDingbats\n\n## ToDo\n\n- [Suggestions / Issues / Fixes](https://github.com/natancabral/pdfkit-table/issues)\n- striped {Boolean} (corsimcornao)\n- colspan - the colspan attribute defines the number of columns a table cell should span.\n- sample with database\n- margin: marginBottom before, marginTop after\n\n## Changelogs\n\n### 0.1.90\n\n- Add options minRowHeight\n  - Thanks LouiseEH ***@LouiseEH***\n```js\n  options: {\n    minRowHeight: 30, // pixel\n  }\n```\n\n### 0.1.89\n\n- Fix first line height\n  - Thanks José Luis Francisco ***@JoseLuis21*** \n\n### 0.1.88\n\n- Fix header font family or title object\n  - Thanks ***@RastaGrzywa***\n```js\nlet localType = \"./font/Montserrat-Regular.ttf\";\nconst table = {\n  title: { label: 'Title Object 2', fontSize: 30, color: 'blue', fontFamily: localType },\n}\n```\n\n### 0.1.87\n\n- Add options hideHeader\n  - Thanks Ville ***@VilleKoo***\n```js\n  options: {\n    hideHeader: true,\n  }\n```\n\n### 0.1.86\n\n- TypeScript (ts) interface (index.ts)\n  - Thanks Côte Arthur ***@CoteArthur***\n\n### 0.1.83\n\n- Avoid a table title appearing alone\n  - Thanks Alexis Arriola ***@AlexisArriola***\n- Problem with long text in cell spreading on several pages\n  - Thanks Ed ***@MeMineToMe***\n\n### 0.1.72\n\n- Add ***Divider Lines*** on options\n```js\n  options: {\n    // divider lines\n    divider: {\n      header: {disabled: false, width: 0.5, opacity: 0.5},\n      horizontal: {disabled: true, width: 0.5, opacity: 0.5},\n    },\n  }\n```\n  - Thanks Luc Swart ***@lucswart***\n\n### 0.1.70\n\n+ Fix ***y*** position.\n  - Thanks Nabil Tahmidul Karim ***@nabiltkarim***\n\n### 0.1.68\n\n+ Added ***Promise***. table is a Promise();\n  - Async/Await function \n```js\n;(async function(){\n  // create document\n  const doc = new PDFDocument({ margin: 30, });\n  // to save on server\n  doc.pipe(fs.createWriteStream(\"./my-table.pdf\"));\n  // tables\n  await doc.table(table, options);\n  await doc.table(table, options);\n  await doc.table(table, options);\n  // done\n  doc.end();\n})();\n```\n\n+ Added ***callback***. \n```js\n  ~~doc.table(table, options, callback)~~;\n```\n\n### 0.1.63\n\n+ Added ***valign*** on headers options. (ex: valign:\"center\")\n+ Added ***headerAlign***, alignment only to header.\n  ```js\n  headers: [\n    {label:\"Name\", property:\"name\", valign: \"center\", headerAlign:\"right\", headerColor:\"#FF0000\", headerOpacity:0.5 }\n  ]\n  ```\n  - Thanks ***@DPCLive***\n\n### 0.1.60\n\n+ Add callback on addBackground function, add .save() and .restore() style.\n+ Header font color\n  - Thanks ***@dev-fema***\n\n### 0.1.59\n\n+ Add padding\n\n### 0.1.57\n\n+ Header color and opacity\n  ```js\n  headers: [\n    {label:\"Name\", property:\"name\", headerColor:\"#FF0000\", headerOpacity:0.5 }\n  ]\n  ```\n  - Thanks ***Albert Taveras*** @itsalb3rt\n\n\n### 0.1.55\n\n+ Align on headers\n  ```js\n  headers: [\n    {label:\"Name\", property:\"name\", align:\"center\"}\n  ]\n  ```\n  - Thanks ***Andrea Fucci***\n\n### 0.1.49\n\n+ Max size page\n\n### 0.1.48\n\n+ Header height size\n+ Separate line width\n\n### 0.1.47\n\n+ addHeader() function on all add pages\n  - Thanks Anders Wasen ***@QAnders***\n\n### 0.1.46\n\n+ addBackground() function to node 8\n  - Thanks ***@mehmetunubol***\n\n### 0.1.45\n\n+ Add **rectCell** on renderer\n  - renderer = ( value, indexColumn, indexRow, row, rectRow, rectCell ) =\u003e {}\n  - Thanks ***Eduardo Miranda***\n\n### 0.1.44\n\n+ Fix paddings and distances\n\n### 0.1.43\n\n+ Remove **rowSpacing**\n+ Fix **columnSpacing**\n\n### 0.1.41\n\n+ **Background** color on header to colorize ***column***\n  - headers: [\n      { label:\"Name\", property: 'name', ***backgroundColor: 'red', backgroundOpacity: 0.5*** },\n      { label:\"Age\", property: 'age', ***background: { color: 'green', opacity: 0.5 } }***,\n  ]\n+ **Background** color inside row options datas\n  - datas: [\n      { name:\"My Name\", age: 20, ***options: { backgroundColor: 'red', backgroundOpacity: 0.5 }*** },\n      { name:\"My Name\", age: 20, ***options: { background: { color: 'green', opacity: 0.5 } }*** },\n  ]\n+ **Background** color inside cell options datas\n  - datas: [\n      { name:{ label: \"My Name\", age: 20, ***options: { backgroundColor: 'red', backgroundOpacity: 0.5 }*** }},\n      { name:{ label: \"My Name\", age: 20, ***options: { background: { color: 'green', opacity: 0.5 } }*** }},\n  ]\n\n### 0.1.39\n\n+ **addBackground**  \u003ccode\u003e{Function}\u003c/code\u003e - Add background peer line. \n  - doc.addBackground( {x, y, width, height}, fillColor, opacity, callback );\n+ **prepareRow**  \u003ccode\u003e{Function}\u003c/code\u003e\n  - const options = { prepareRow: (row, indexColumn, indexRow, rectRow, rectCell) =\u003e { indexColumn === 0 \u0026\u0026 doc.addBackground(rectRow, 'red', 0.5) } }\n\n### 0.1.38\n\n+ **tables**  \u003ccode\u003e{Function}\u003c/code\u003e - Add many tables. \n  - doc.tables([ table0, table1, table2, ... ]);\n\n### 0.1.37\n\n+ **addPage**  \u003ccode\u003e{Boolean}\u003c/code\u003e - Add table on new page.\n  - const options = { addPage: true, }; \n\n### 0.1.36\n\n+ Fix position x, y of title\n+ **options.x**: **null** | **-1** // reset position to margins.left\n\n### 0.1.35\n\n+ add **title** \u003ccode\u003e{String}\u003c/code\u003e\n  - const table = { title: \"\", };\n  - const options = { title: \"\", };\n+ add **subtitle** \u003ccode\u003e{String}\u003c/code\u003e\n  - const table = { subtitle: \"\", };\n  - const options = { subtitle: \"\", };\n\n### 0.1.34\n\n+ add **columnsSize** on options = {} // only to simple table\n\n### 0.1.33\n\n+ Function **tableToJson**\n  - import {tableToJson} from 'pdfkit-table';\n  - const table = tableToJson('#id_table'); \u003ccode\u003e{Object}\u003c/code\u003e\n+ Function **allTablesToJson**\n  - import {allTablesToJson} from 'pdfkit-table';\n  - const tables = allTablesToJson(); \u003ccode\u003e{Array}\u003c/code\u003e\n\n### 0.1.32\n\n+ spacing cell and header alignment\n+ **Thank you, contributors!**\n\n### 0.1.31\n\n+ renderer function on json file. { \"renderer\": \"function(value, icol, irow, row){ return (value+1) + `(${(irow+2)})`; }\" }\n+ fix width table and separation lines size \n\n## License\n\nThe MIT License.\n\n## Author\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"https://github.com/natancabral.png?s=100\" width=\"100\"/\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      Natan Cabral\u003cbr /\u003e\n      \u003ca href=\"mailto:natancabral@hotmail.com\"\u003enatancabral@hotmail.com\u003c/a\u003e\u003cbr /\u003e\n      \u003ca href=\"https://github.com/natancabral/\"\u003ehttps://github.com/natancabral/\u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Thank you\n\n- pdfkit - [pdfkit](https://www.npmjs.com/package/pdfkit)\n- ideas - [giuseppe-santoro](https://github.com/foliojs/pdfkit/issues/29#issuecomment-56504943)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatancabral%2Fpdfkit-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatancabral%2Fpdfkit-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatancabral%2Fpdfkit-table/lists"}