简体   繁体   中英

Build content block in Prawn?

This seems to be easy but I can't find a solution. I have a table like this:

table([["cell 1","cell 2","cell 3" ]]

I want to do something like this:

content = block do
 text 'Location'
 text 'Location2'
end

table([[content,"cell 2","cell 3" ]]

Can you do this in Prawn?

You might be able to do this with a custom table cell implemetnation. However, as far as I know this is not possible with prawn-table itself.

The problem with what you want is that the auto-sizing of a cell gets much more complicated if complex content is allowed in a table cell.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM