Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tables in pdfMake.js and page break, how to delete bottom empty row

Table with empty row

on this example you see, when the table breaks it leaves one empty row, that the same, as the first row on the next page.

Question, how can I delete this empty row, that it looks better.

Thank for help

like image 602
Woldemar960 Avatar asked Aug 14 '17 14:08

Woldemar960


1 Answers

Use this

table: {
    dontBreakRows: true, 
}

Full explanation, assuming a table that spans two pages (not necessarily due to its own height):

  • default (none of these 3 properties) - The first row of the table only appears once. If the last row on page 1 is too tall, half of that row will be on page 1 and half on page 2.
  • headerRows: 1 - Identifies the first 1 row as the header row(s). Identified header row(s) appear at the top of both the first and second page of the table.
  • dontBreakRows: true - A row cannot be split in half across pages. (in the pdfMake playground Tables example's Header section, the table is a header row and one tall content row, so the content row only appears on page 2).
  • keepWithHeaderRows: true (requires identified headerRows) - If page 1 only has room for the header row(s) and no content rows, this will NOT show the header(s) on page 1, in favor of keeping them with any content rows, on page 2.
like image 175
BeatriceThalo Avatar answered Sep 18 '22 02:09

BeatriceThalo