Module: PDFGen::TableContainer

Included in:
Div, Document, Span
Defined in:
lib/containers/table_container.rb

Instance Method Summary collapse

Instance Method Details

#table(style = nil, &initialization_block) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/containers/table_container.rb', line 5

def table(style = nil, &initialization_block)
  table = (style.is_a?(Hash) and style.has_key?(:data_source)) ?
          SmartTable.new(self) : Table.new(self)
  table.set_properties style unless style.nil?
  table.instance_eval(&initialization_block) if initialization_block
  self.add_region(table)
end