pdfmake icon indicating copy to clipboard operation
pdfmake copied to clipboard

Columns Widths inconsistent with multiple columns

Open SutleB opened this issue 5 years ago • 1 comments

It seems that when doing column widths, there is a padding value that is not mentioned. This causes issues when trying to be accurate with multiple columns. oh dang

SutleB avatar Jan 21 '21 23:01 SutleB

Hi @SutleB I had the same issue, the cells have a default padding that you can override in the layout.

layout: { paddingLeft: function(i, node) {return 0 }, paddingRight: function(i, node) { return 0; }, paddingTop: function(i, node) { return 0; }, paddingBottom: function(i, node) { return 0; }, // fillColor: function (i, node) { return null; } },

As a workaround you can add a margin to every element to have the same behaviour.

body: [ [{text: 'Column 1', margin:[5,5,5,5]}, 'Column 2', 'Column 3'],

erdotufa avatar Feb 18 '21 06:02 erdotufa