pdfmake icon indicating copy to clipboard operation
pdfmake copied to clipboard

Padding around column text with background

Open mpsbhat opened this issue 8 years ago • 1 comments

Here is a sample doc as,

var dd = { content: [ { text:'SAMPLE TEXT', bold: true, fontSize: 16, background: 'black', color: 'white', margin: [60, 5, 20, 5]}, ] }

which make a black background to the column text. Now how can we give some padding arround the text so that backgroud should more wider as show below.

Offcourse, we can do it trough table object but using column itself is appreciated.

st

mpsbhat avatar Sep 27 '18 05:09 mpsbhat

var dd = { content: [ { text:'\t\t\t\t\tSAMPLE TEXT\t\t\t\t\t', bold: true, fontSize: 16, background: 'black', color: 'white', widhth:120, alignment:'center', margin:[0,180,0] }, ]

} //By increasing the value of middle one of margin you can increase the padding around the text

AnuradhaSharma000111 avatar Feb 20 '19 13:02 AnuradhaSharma000111