prawnpdf / prawn-table

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

Inner tables don't respect cell padding #150

Open rhysb27 opened 1 year ago

rhysb27 commented 1 year ago

Inner tables appear to work fine when the inner table is only acting as a mechanism for splitting cells. However in my case, I want to give the actual appearance of a table within a table cell, using the cell's padding to achieve this. For example:

references = [
  ["Regulation", "(5.4.2)", "Example link"],
  ["Regulation", "(5.4.2)", "Example link"],
  ["Standard", "(5.4.2)", "Example link"],
  ["Best Practice", "(5.4.2)", "Example link"],
]

references_table = make_table(references, cell_style: { borders: [], size: 10 })

table_data = [
  ["Action will go here"],
  [{ content: references_table, padding: 15 }],
]

make_table(table_data, width: 452, cell_style: { size: 10, background_color: "FFFFFF" })

... results in: table-not-respecting-padding

Whereas merely replacing references_table with text results in: text-respecting-padding

How come text respects the cell's padding while the inner table doesn't?

bellef commented 4 months ago

👍 Same here but instead I would like no padding at all on the outside of the nested table