I am trying pdfmake, adding headers with coleman - mixing the doc examples and playground
this is my jsfidlle : http://jsfiddle.net/sn2pyyLy/8/
and here the text, which as you can see if very simple, but i am obviously doing some error I cannot see since i get the following error:
pdfmake.js:15228 Uncaught TypeError: Cannot create property 'positions' on string 'The last one2'
Is this not the way of declaring a colspan ? I took that from the playground, what did I miss ? thanks
var docDefinition = {
content: [
{
table: {
headerRows: 2,
widths: [ '', 'auto', 100, '' ],
body: [
[ { text: 'Header with Colspan = 2', colSpan: 2,alignment: 'center' }, 'Third', 'The last one' ],
[ 'First2', 'Second2', 'Third2', 'The last one2' ],
[ 'Value 1', 'Value 2', 'Value 3', 'Value 4' ],
[ { text: 'Bold value', bold: true }, 'Val 2', 'Val 3', 'Val 4' ]
]
}
}
]
};
Oups, understood. I was doing everything like in HTML - if I have a colspan, I ignore the colonne.
Added {} and it works
{ text: 'Header with Colspan = 2', colSpan: 2,alignment: 'center' },{}, 'Third', 'The last one'
read to fast everything.
Most helpful comment
Oups, understood. I was doing everything like in HTML - if I have a colspan, I ignore the colonne.
Added {} and it works
{ text: 'Header with Colspan = 2', colSpan: 2,alignment: 'center' },{}, 'Third', 'The last one'
read to fast everything.