jsPDF Autotable Tutorial: Give Different Widths to Columns & Rows of Table in PDF Document

0Shares

You have to convert your columnWidth array to look like this:

doc.autoTable({
  html: '#table',
  columnStyles: {
    0: {cellWidth: 100},
    1: {cellWidth: 80},
    2: {cellWidth: 80},
    // etc
  }
});

A point to be noted is that here we used columnStyles instead of styles.

0Shares

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.