In PDFMake I set the height and weight of table, but it isn't work

30
November 21, 2020, at 9:10 PM

I've created tables with pdfmake. The pagesize and the columns size was fixed. But the two table in one row is merging. What should I do?

An another problem is that in the second column isn't showing.

The document definition is

{
  pageSize: { width: 595.275590551181, height: 841.8897637795275 },
  pageMargins: [ 0, 0, 0, 0 ],
  content: [
    {
      columns: [
        {
          width: 297.6377952755905,
          table: {
            headerRows: 2,
            widths: [ 148.81889763779526, 148.81889763779526 ],
            heights: [
              59.932508436445445,
              59.932508436445445,
              59.932508436445445,
              59.932508436445445,
              59.932508436445445,
              59.932508436445445,
              59.932508436445445
            ],
            body: [
              [ { text: '108', colSpan: 2 } ],
              [
                { text: 'Név', colspan: 1 },
                { text: 'Csoport', colspan: 1 }
              ],
              [ { text: 'I', colspan: 1 }, { text: '-', colspan: 1 } ],
              [ { text: 'Y', colspan: 1 }, { text: '-', colspan: 1 } ],
              [ { text: 'Z', colspan: 1 }, { text: '-', colspan: 1 } ],
              [ { text: 'K', colspan: 1 }, { text: '-', colspan: 1 } ],
              [ { text: 'X', colspan: 1 }, { text: '-', colspan: 1 } ]
            ]
          }
        },
        {
          width: 297.6377952755905,
          table: {
            headerRows: 2,
            widths: [ 148.81889763779526, 148.81889763779526 ],
            heights: [
              83.90551181102362,
              83.90551181102362,
              83.90551181102362,
              83.90551181102362,
              83.90551181102362
            ],
            body: [
              [ { text: '206', colSpan: 2 } ],
              [
                { text: 'Név', colspan: 1 },
                { text: 'Csoport', colspan: 1 }
              ],
              [ { text: 'U', colspan: 1 }, { text: '-', colspan: 1 } ],
              [ { text: 'Q', colspan: 1 }, { text: '-', colspan: 1 } ],
              [ { text: 'I', colspan: 1 }, { text: '-', colspan: 1 } ]
            ]
          }
        }
      ],
      columnGap: 0
    }
  ]
}

Click to see the result!

Thanks in advance for the solution!

READ ALSO
Get Firebase token from external API in my test cases

Get Firebase token from external API in my test cases

I have written custom nodejs authentication utilising the firebase token based auth module

43
env variables set from the code are not available in imported modules in node.js

env variables set from the code are not available in imported modules in node.js

How to set environment variables in the code so they are available in imported NPM modules?

49
Is there any way to cache the API response in VueJS

Is there any way to cache the API response in VueJS

In our VueJS application, we are having few API's which are calling each and every time whenever the page reloadsIn those API's

33
Benchmark express apis with autocannon

Benchmark express apis with autocannon

I need to benchmark all my express apisI found this package on github

50