Pdfmake: How assign custom layouts to a table

Created on 18 Jun 2018  路  4Comments  路  Source: bpampuch/pdfmake

Hi,

I read this
https://github.com/bpampuch/pdfmake#own-table-layouts

But I don't know how assign _exampleLayout_ to my table.

Like this maybe :

table: { ..... }, layout: exampleLayout

or as a style:

style: 'exampleLayout', table: { ..... }

Thank's

Most helpful comment

I've done it !

So, first define _pdfMake.tableLayouts_ first of the _docDefinition_
Then in the _docDefinition_ assign the custom layout to a table like this :
table:{...},layout:pdfMake.tableLayouts.Mylayout

where _Mylayout_ is the name set in the tableLayouts

pdfMake.tableLayouts = { Mylayout: {...} };

var docDefinition = { ... table:{...},layout:pdfMake.tableLayouts.Mylayout ...}

All 4 comments

There is an example here: http://pdfmake.org/playground.html click the Tables example

In the playground / tables , there are no examples regarding my request.
In fact there are only layouts specified within the content code.
In the page
the pdfMake.tableLayouts is wrote outside the content code.

So, how I can assign the custom Layout defined outside the content code to the tables inside the content code ?

Thank's

Normally in the _docDefinition_ you set the layout of the tables.
But I wish to define the layout of the tables in the object _pdfMake.tableLayouts_ outside of the _docDefinition_ object .
But I don't know how assign the layout to the tables.

I've try
table:{...},layout: name

where _name_ is the name set in the tableLayouts

but does not work

Please, can you tell me how I've to do ..

Thank's

I've done it !

So, first define _pdfMake.tableLayouts_ first of the _docDefinition_
Then in the _docDefinition_ assign the custom layout to a table like this :
table:{...},layout:pdfMake.tableLayouts.Mylayout

where _Mylayout_ is the name set in the tableLayouts

pdfMake.tableLayouts = { Mylayout: {...} };

var docDefinition = { ... table:{...},layout:pdfMake.tableLayouts.Mylayout ...}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dgrice picture dgrice  路  3Comments

davidyeiser picture davidyeiser  路  3Comments

CharlyPoppins picture CharlyPoppins  路  3Comments

kumarandena picture kumarandena  路  3Comments

sayjeyhi picture sayjeyhi  路  3Comments