Khyati Desai
Khyati Desai

Reputation: 43

pdfMake fillcolor for table column with row

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' }

enter image description here

Upvotes: 1

Views: 1439

Answers (1)

H S W
H S W

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

Related Questions