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

1

7

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

Chapter answered 14/8, 2017 at 14:21 Comment(3)
This is photo imgur.com/a/mwarQChapter
how did you add a new page if your page exceed the page size?Unsteel
@NikhilRadadiya Make sure any empty cells are using ' ' and not ''Renunciation
R
20

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.
Renunciation answered 22/2, 2018 at 13:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.