prawnpdf / prawn-table

Provides support for tables in Prawn
Other
205 stars 98 forks source link

Layout broken when using rowspan with repeatable footer #133

Open laurafeier opened 2 years ago

laurafeier commented 2 years ago

Reproducible with:

idx = 0
rows = 31.times.map { [{ content: (idx += 1).to_s }] }
rows.first.unshift({ content: "col 1", rowspan: rows.count })

pdf = Prawn::Document.new

pdf.bounding_box([pdf.bounds.left, pdf.cursor], width: pdf.bounds.width) do
  pdf.table(rows, cell_style: { borders: [:bottom], border_colors: 'CCCCCC' })
end

pdf.repeat(:all) do
  pdf.bounding_box([pdf.bounds.left, pdf.bounds.bottom], width: pdf.bounds.width, height: 30) do
    pdf.text("footer")
    pdf.stroke_bounds
  end
end

Ruby version: 3.0.2 Prawn version: 2.4.0 Prawn table version: 0.2.2

Result: bug.pdf

Issues:

  1. first page rows from the second columns are missing
  2. first column's bottom border should be rendered on the second page, inline with the last row, not on the first page overlapping with the footer