我有正确的代码,但虾抱怨它:
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)