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.
13 14 15 16 17 |
# File 'lib/prawn/markup/builders/table_builder.rb', line 13 def initialize(pdf, cells, total_width, = {}) super(pdf, total_width, ) @cells = cells @column_widths = [] end |
Instance Method Details
#draw ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/prawn/markup/builders/table_builder.rb', line 24 def draw # fix https://github.com/prawnpdf/prawn-table/issues/120 pdf.font_size([:cell][:size] || pdf.font_size) do make.draw end rescue Prawn::Errors::CannotFit => e if failover_on_error draw else raise e end end |
#make ⇒ Object
19 20 21 22 |
# File 'lib/prawn/markup/builders/table_builder.rb', line 19 def make compute_column_widths pdf.make_table(convert_cells, ) end |