0
votes

I'm using jspdf-autotable on angular 4. The line width is wrong when there is an overflow of content. I will like to use long content on my table but the breakline doesn't work right. What can i do????

THis is the screenshort of my result

There is my source code

doc.autoTable(colonnes, rows, {    
    theme: 'striped',
      styles: {
        fillColor: [10, 10, 20],
        overflow: 'linebreak',
        fontSize: 15,
        rowHeight: 20,
        columnWidth: 'wrap',
        theme: 'striped',// 'striped', 'grid' or 'plain'
        startY: false, // false (indicates margin top value) or a number
        pageBreak: 'auto', // 'auto', 'avoid' or 'always'
        tableWidth: 'wrap', // 'auto', 'wrap' or a number, 
        showHeader: 'firstPage', // 'everyPage', 'firstPage', 'never',
        tableLineColor: 200, // number, array (see color section below)
        tableLineWidth: 2,
      },
      tableWidth: 'auto',
      columnWidth: 'auto',
      columnStyles: {
        id: {fillColor: [15, 15,25]},
        //1: {columnWidth: 'auto'},
        columnWidth: 'wrap',
      },
      headerStyles: {theme: 'striped'},
      margin: {top: 60},
      addPageContent: function(data) {
        doc.text(nom + '    Nombre Total : ' + rows.length, 150, 40);
        /*fontSize: 25;
        fontFamily: 'vivaldi';*/
      }
  });

doc.save(nom+now+'.pdf');
1

1 Answers

0
votes

In columnStyles add 'overflow: '

Possible values for overflow:

overflow: 'linebreak'|'ellipsize'|'visible'|'hidden' = 'normal'

columnStyles = { columnId: { overflow: 'ellipsize' } }