Pdfmake: table padding

Created on 29 Jun 2015  Â·  6Comments  Â·  Source: bpampuch/pdfmake

Hi, is there a way to add padding in text into table?
I want to set a space between the border of the table and the text into the table.

Most helpful comment

You can define custom paddings, please refer to the "tables" example in Playground, custom layout has paddings commented out, but you can uncomment them

paddingLeft: function(i, node) { return 4; },
paddingRight: function(i, node) { return 4; },
paddingTop: function(i, node) { return 2; },
paddingBottom: function(i, node) { return 2; }

All 6 comments

Hi Loverdrive,

I did it by "hacking" the different table styles in pdfMake.

You can do it by specifying certain types of table layouts. Check out the
documentation on tables with the corresponding style: noBorders.

Find noBorders in the source code of pdfMake, and you'll see the padding
parameters there. If you need any help just let me know :).

Cheers!

On 29 June 2015 at 10:32, loverdrive [email protected] wrote:

Hi, is there a way to add padding in text into table?
I want to set a space between the border of the table and the text into
the table.

—
Reply to this email directly or view it on GitHub
https://github.com/bpampuch/pdfmake/issues/345.

Now i solved adding margin to the text in the table:

{ text: 'some text here', style: 'tableStyle', margin: [0, 15, 0, 0]}

Thank you :)

Ahh good to know! I will incorporate this, thnx!

On 29 June 2015 at 15:35, loverdrive [email protected] wrote:

Now i solved adding margin to the text in the table:

{ text: 'some text here', style: 'tableStyle', margin: [0, 15, 0, 0]}

Thank you :)

—
Reply to this email directly or view it on GitHub
https://github.com/bpampuch/pdfmake/issues/345#issuecomment-116661903.

You can define custom paddings, please refer to the "tables" example in Playground, custom layout has paddings commented out, but you can uncomment them

paddingLeft: function(i, node) { return 4; },
paddingRight: function(i, node) { return 4; },
paddingTop: function(i, node) { return 2; },
paddingBottom: function(i, node) { return 2; }

Thank you very much for the answer! :)

@bpampuch is that padding and margins added to whole table or on every cells ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

einfallstoll picture einfallstoll  Â·  3Comments

dmatesic picture dmatesic  Â·  3Comments

dgrice picture dgrice  Â·  3Comments

SummerSonnet picture SummerSonnet  Â·  3Comments

kamilkp picture kamilkp  Â·  3Comments