Im trying to fill a Table with an array that contains persons objects, the clg displays the same structure as the example from the plugin github.
My array with objects:
JsPDF- Autotable Array with Objects:
Im setting as row the array var but my table is displaying like this:
The table is drawing 3 rows, one for each object, but no data displayed.
This is my pdf generator code
let genPdf = () => {
var doc = new jsPDF('l', 'pt');
doc.autoTable(cols,rowArray, {
// Styling
theme: 'striped', // 'striped', 'grid' or 'plain'
styles: {overflow: 'linebreak',columnWidth: 'wrap',lineWidth: 1,cellPadding: 2, fontSize: 10 },
columnStyles: { text: { columnWidth: 'auto' } },
headerStyles: {},
bodyStyles: {},
alternateRowStyles: {},
// Properties
startY: 30, // false (indicates margin top value) or a number
margin: 40, // a number, array or object
pageBreak: 'auto', // 'auto', 'avoid' or 'always'
tableWidth: 'auto', // 'auto', 'wrap' or a number,
showHeader: 'everyPage', // 'everyPage', 'firstPage', 'never',
tableLineColor: 200, // number, array (see color section below)
tableLineWidth: 0,
// Hooks
});
doc.setPage(1 + doc.internal.getCurrentPageInfo().pageNumber - doc.autoTable.previous.pageCount);
doc.save('reporte.pdf');}