0

我有正确的代码,但虾抱怨它:

class MyClass < Prawn::Document
  # ....
  def def123      
    table main_table , width: bounds.width 
  end

  def main_table
    [[ 
      "0","1", "2", "3", "4"
    ]] + 
    [
      [{content: "data1", colspan: 4}, "111"],
      [{content: "data2", colspan: 4}, "222"],
      [{content:"data3", colspan: 4}, "333"]
    ]
  end
end

说:

undefined method  colspan=  for Prawn::Table::Cell::Text:0x007fb86c3e7020

请注意,我需要使用width: bounds.width才能使表格填满整个页面。

对虾 (0.12.0)

4

1 回答 1

2

我建议更新您的 Gem 文件以直接从 git 存储库中提取对虾。大多数undefined method错误是使用过时版本的结果:

gem 'prawn', :git => "https://github.com/prawnpdf/prawn.git"

于 2013-09-28T15:05:49.223 回答