Skip to content

jsPDF.table wrong output #1663

@Danny-P

Description

@Danny-P

Hi,

I used the following to output a table to a PDF.
The row height is very high and the width of the table is higher than the page size. The last column ("KM") is not shown because it is behind the margin.

Is this a bug or do I something wrong?

const tableHeader = ['Datum', 'Bemerkung', 'KM'];

    const tableData = [
      { 
        "Datum": "01.02.2018",
        "Bemerkung": "Patient 1, Patient 2, Patient 3, Patient 4, Patient 5",
        "KM": 100
      },
      { 
        "Datum": "02.02.2018",
        "Bemerkung": "Patient 1, Patient 2, Patient 3",
        "KM": 20
      }
    ];

    const doc = new jsPDF('portrait', "mm", "a4");
doc.table(10, 60, tableData, tableHeader, {
      margins: {
        top: 0,
        bottom: 0
      },
      width: 150,
      autoSize: true,
      printHeaders: true,
      rowMargin: 0,
      fonstSize: 12
    }

Screenshot of the output:
grafik

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions