开发者

prawn PDF: I need to generate nested tables

开发者 https://www.devze.com 2022-12-22 02:00 出处:网络
开发者_Go百科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?Subtables are now supported:
开发者_Go百科

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?


Subtables are now supported:

Prawn::Document.generate("subtable.pdf") do |pdf|
  subtable = pdf.make_table([["sub"], ["table"]])
  pdf.table([[subtable, "original"]])
end


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.


Table nesting was actually the major inspiration for Crayfish.
As far as I know Prawn still can't do proper sizing and cell placements on more sophisticated tables.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号