This is the 2x2 table I need to generate:
开发者_如何学Cr1c1 r1c2
r2c1 r2c1
----
In other words I should print the bottom border of the bottom right cell. This is my code:
show.pdf.prawn
#This is a two dimensional array:
my_array = [["r1c1","r1c2"],["r2c1",Prawn::Table::Cell.new(:text => "r2c2", :border_width => 1 , :borders => :bottom)]]
#Table
pdf.table my_array, :border_width => 0
Well, with this code I have a 2x2 table with no borders!
Has someone any tip?
Here one solution better known as workaround:
#This is a two dimensional array:
my_array = [["r1c1","r1c2"],["r2c1",Prawn::Table::Cell.new(:text => "r2c2", :border_width => 1 , :borders => [:bottom])]]
#Table
pdf.table my_array,
#:headers => ["h1","h2"],
:border_style => :underline_header
Omitting headers => ["h1","h2"] you avoid the underlined header.
精彩评论