2

这是我需要生成的 2x2 表:

r1c1  r1c2
r2c1  r2c1
      ----

换句话说,我应该打印右下角单元格的底部边框。这是我的代码:

显示.pdf.虾

#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

好吧,有了这段代码,我就有了一个没有边框的 2x2 表格!

有人有小费吗?

4

1 回答 1

0

这里有一个更好地称为解决方法的解决方案:

#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

省略标题 => ["h1","h2"]可以避免带下划线的标题。

于 2009-12-19T21:36:59.330 回答