'In PDFMake I set the height and width of table, but it isn't work
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
}
]
}
Thanks in advance for the solution!
Solution 1:[1]
You can solve it by setting margin in each table:
//Here change the margin values according to your requirement
margin: [20, 5, 0, 10],
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | H S Progr |

