Different width for each columns in jspdf autotable?

前端 未结 4 1619
谎友^
谎友^ 2021-01-01 18:06

My table has 13 columns. How can I get different width for each column? Can I give each column width like this?

styles: {overflow: \'linebreak\' ,columnWidt

4条回答
  •  被撕碎了的回忆
    2021-01-01 19:04

    You would have to transform your columnWidth array to look like this:

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

    Note the use of columnStyles instead of styles.

提交回复
热议问题