Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

prawn PDF: I need to generate nested tables

I need a table where rows are actually 2 rows tables, a nested table that is.. How can I do that in prawn? Maybe I need an extension.. but which one?

like image 748
luca Avatar asked Mar 04 '10 12:03

luca


2 Answers

Subtables are now supported:

Prawn::Document.generate("subtable.pdf") do |pdf|
  subtable = pdf.make_table([["sub"], ["table"]])
  pdf.table([[subtable, "original"]])
end
like image 97
Justin Tanner Avatar answered Oct 06 '22 00:10

Justin Tanner


No support for this exists in released versions, but in the master branch of http://github.com/sandal/prawn you'll find our revamped table support which has nested tables. Take a look at the examples/ dir.

like image 22
Gregory Brown Avatar answered Oct 05 '22 23:10

Gregory Brown