Pdfmake: Reusing table second renders empty

Created on 31 Jan 2017  路  2Comments  路  Source: bpampuch/pdfmake

Hi!
First of all, awsome library, thx for the work so far!

I've stepped into an issue when trying to reuse a table in the document content. The first one shows ok, but the second one only renders the lines... no content at all.
I've reproduced it in the playground with:

var table = {
    style: 'tableExample',
    table: {
        body: [
            ['Column 1', 'Column 2', 'Column 3'],
            ['One value goes here', 'Another one here', 'OK?']
        ]
    }
}
var dd = {
    content: [
        table,
        table
    ],
    styles: {
        tableExample: {
            margin: [0, 5, 0, 15]
        }
    }
}

Any way around this? thanks in advance

Most helpful comment

duplicate: https://github.com/bpampuch/pdfmake/issues/465

For example, you can insert from function:

function getTable() {
    return { style: 'tableExample', table: { body: [ ['Column 1', 'Column 2', 'Column 3'], ['One value goes here', 'Another one here', 'OK?'] ] } } 
}

var dd = { 
    content: [ getTable(), getTable() ], 
    styles: { tableExample: { margin: [0, 5, 0, 15] } }
}

All 2 comments

duplicate: https://github.com/bpampuch/pdfmake/issues/465

For example, you can insert from function:

function getTable() {
    return { style: 'tableExample', table: { body: [ ['Column 1', 'Column 2', 'Column 3'], ['One value goes here', 'Another one here', 'OK?'] ] } } 
}

var dd = { 
    content: [ getTable(), getTable() ], 
    styles: { tableExample: { margin: [0, 5, 0, 15] } }
}

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidyeiser picture davidyeiser  路  3Comments

einfallstoll picture einfallstoll  路  3Comments

imoum007 picture imoum007  路  3Comments

jkd003 picture jkd003  路  3Comments

jokris1 picture jokris1  路  3Comments