最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Tables in pdfMake.js and page break, how to delete bottom empty row - Stack Overflow

programmeradmin0浏览0评论

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

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

Share Improve this question edited Aug 14, 2017 at 14:26 Woldemar960 asked Aug 14, 2017 at 14:21 Woldemar960Woldemar960 711 gold badge1 silver badge4 bronze badges 3
  • This is photo imgur.com/a/mwarQ – Woldemar960 Commented Aug 14, 2017 at 14:25
  • how did you add a new page if your page exceed the page size? – Nikhil Radadiya Commented Aug 23, 2017 at 13:32
  • @NikhilRadadiya Make sure any empty cells are using ' ' and not '' – Michelle Norris Commented Feb 23, 2018 at 14:01
Add a comment  | 

1 Answer 1

Reset to default 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.
发布评论

评论列表(0)

  1. 暂无评论