Pdfmake: Specify alignment for table, not just cells

Created on 30 Oct 2015  路  2Comments  路  Source: bpampuch/pdfmake

I'm building a large table with all cell content centered within each cell except for two of the columns. I know I can add alignment: 'center' to individual cells, but it would be nice set that at the table level as well to be more efficient. I tried specifying the alignment at the table level, but it didn't work. Setting the alignment on individual cells should still work and override what is set at the table level.

table

Most helpful comment

@liborm85 It doesn't center the table.

Screenshot 2019-06-03 at 5 12 55 PM

All 2 comments

Yes, it is possible.
Example:

var dd = {
    content: [
        {
            'alignment': 'center',
            table: {
                body: [
                    ['Column 1', 'Column 2', 'Column 3'],
                    ['One value goes here', 'Another one here', 'OK?']
                ]
            }
        }
    ]
}

@liborm85 It doesn't center the table.

Screenshot 2019-06-03 at 5 12 55 PM

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sayjeyhi picture sayjeyhi  路  3Comments

ValeSauer picture ValeSauer  路  3Comments

imoum007 picture imoum007  路  3Comments

dgrice picture dgrice  路  3Comments

jkd003 picture jkd003  路  3Comments