Reputation: 43
i am generating pdf content dynamically. i wanted color last column of this table in green. i am new to pdfmake. How to achieve that?
column fill color i have achieved using below. but not getting how to fill cell color of that column.
{
text: T
,
style: 'tableHeader',
field: ``,
border: [true, true, true, true],
fillColor: '#00ff73'
}
Upvotes: 1
Views: 1439
Reputation: 7139
you can do it as follow:
layout: {
fillColor: function(rowIndex, node, columnIndex) {
// You can change condition according to your requirements
return columnIndex=== yourColumnsArray.length-1 ? 'green' : grey;
},
}
Upvotes: 0