Class: Prawn::Markup::Builders::TableBuilder
- Inherits:
-
NestableBuilder
- Object
- NestableBuilder
- Prawn::Markup::Builders::TableBuilder
- Defined in:
- lib/prawn/markup/builders/table_builder.rb
Constant Summary collapse
- FAILOVER_STRATEGIES =
%i[equal_widths subtable_placeholders].freeze
- DEFAULT_CELL_PADDING =
5
- MIN_COL_WIDTH =
1.cm
Constants inherited from NestableBuilder
NestableBuilder::TEXT_STYLE_OPTIONS
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(pdf, cells, total_width, options = {}) ⇒ TableBuilder
constructor
A new instance of TableBuilder.
- #make ⇒ Object
Constructor Details
#initialize(pdf, cells, total_width, options = {}) ⇒ TableBuilder
Returns a new instance of TableBuilder.
11 12 13 14 15 |
# File 'lib/prawn/markup/builders/table_builder.rb', line 11 def initialize(pdf, cells, total_width, = {}) super(pdf, total_width, ) @cells = cells @column_widths = [] end |
Instance Method Details
#draw ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/prawn/markup/builders/table_builder.rb', line 22 def draw make.draw rescue Prawn::Errors::CannotFit => e if failover_on_error draw else raise e end end |
#make ⇒ Object
17 18 19 20 |
# File 'lib/prawn/markup/builders/table_builder.rb', line 17 def make compute_column_widths pdf.make_table(convert_cells, ) end |