0
votes

preparing summary report in jspdf-autotable.How do i hide empty column and header

const headers=[["PRICE","CARRIER","CUSTOMER ID","QUANTITY"]] 
const data = this.state.data.map(elt=> [elt.price,elt.carrier,elt.from,elt.duration]); 

let content = {
  startY: 50,
  head: headers,
  body: data,

};

doc.text(title, marginLeft, 40);
doc.autoTable(content);

I expect output to hide customerid in pdf because it does not have any data in tableenter image description here

1

1 Answers

0
votes

The easiest solution is probably to filter those values out before passing them to the plugin.