Pdfmake: Uncaught TypeError: Cannot create property 'positions' on string

Created on 24 Nov 2016  路  1Comment  路  Source: bpampuch/pdfmake

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' ]
]
}
}
]
};

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jokris1 picture jokris1  路  3Comments

michaelqiji picture michaelqiji  路  3Comments

kamilkp picture kamilkp  路  3Comments

dgrice picture dgrice  路  3Comments

imoum007 picture imoum007  路  3Comments