Multi-line header jsPDF

0

I need to generate pdf from a table, but my header has several lines and my code is overlapping these lines,

I need every tr to be on a different line, how could it be?

var startColPosition=defaults.pdfLeftMargin;
$(el).find('thead').find('tr').each(function() {
     $(this).filter(':visible').find('th').each(function(index,data) {
            if ($(this).css('display') != 'none'){                  
                 if(defaults.ignoreColumn.indexOf(index) == -1){
                       var colPosition = startColPosition+ (index * 50);                                    
                       doc.text(colPosition,20, parseString($(this)));
                  }
            }
      });                                   
}); 
    
asked by anonymous 11.09.2018 / 22:43

1 answer

3

Hello, doing this is more complex, so I recommend using the jsPDF-AutoTable plugin that deals with printing tables in a simple way. See here on Git jspdf & auto table

    
04.10.2018 / 19:25