Class: PrawnHtml::Tags::Col

Inherits:
PrawnHtml::Tag show all
Defined in:
lib/prawn_html/tags/col.rb

Constant Summary collapse

ELEMENTS =
[:col].freeze

Constants inherited from PrawnHtml::Tag

PrawnHtml::Tag::CALLBACKS, PrawnHtml::Tag::TAG_CLASSES

Instance Attribute Summary

Attributes inherited from PrawnHtml::Tag

#attrs, #parent, #tag

Instance Method Summary collapse

Methods inherited from PrawnHtml::Tag

#block?, #block_styles, class_for, #initialize, #process_styles, #tag_close_styles, #tag_open_styles

Constructor Details

This class inherits a constructor from PrawnHtml::Tag

Instance Method Details

#on_context_add(_context) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/prawn_html/tags/col.rb', line 8

def on_context_add(_context)
  table_parent = find_parent_of_type(PrawnHtml::Tags::Table)
  return unless table_parent

  width = parse_width
  table_parent.add_col_width(width) if width
end