Class: DynamicImageElements::TableCellElement

Inherits:
BlockElement
  • Object
show all
Defined in:
lib/elements/table_cell_element.rb

Overview

Element is used for compositing another elements in it. It’s inherited from BlockElement and can be used in same way.

Instance Method Summary collapse

Methods inherited from BlockElement

#block, #image, #table, #text

Methods included from ElementInterface

#final_size, #set_height, #set_width

Constructor Details

#initialize(options, parent = nil, &block) ⇒ TableCellElement

Table cell element accepts options Hash. Block can be given and class provides element self to composite elements in it.

See BlockElement.new for more information

Options

Options are same as for BlockElement. You can also use further options to set cell behavior.

:colspan

Sets number of columns which this cells takes. Don’t create next cells for already taken space.

:rowspan

Sets number of rows which this cells takes. Don’t create next cells for already taken space.

:width

Same as described in BlockElement. You can also set "0%" to fit all remaining space and ather elements will fit to its minimum size.



21
22
23
# File 'lib/elements/table_cell_element.rb', line 21

def initialize(options, parent = nil, &block) # :yields: block_element
  super options, parent, &block
end

Instance Method Details

#heightObject

Gets height for inner elements



30
31
32
# File 'lib/elements/table_cell_element.rb', line 30

def height #:nodoc:
  @options[:height]
end

#widthObject

Gets width for inner elements



26
27
28
# File 'lib/elements/table_cell_element.rb', line 26

def width #:nodoc:
  @options[:width]
end