Class: Wizport::Html::Table

Inherits:
Element
  • Object
show all
Defined in:
lib/wizport/document/html/table.rb

Constant Summary collapse

DEFAULT_COLUMN_WIDTH =
40

Instance Method Summary collapse

Methods inherited from Element

#tag

Constructor Details

#initialize(html, rows = [], options = {}, &block) ⇒ Table

Returns a new instance of Table.



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/wizport/document/html/table.rb', line 10

def initialize(html, rows = [], options = {}, &block)
  super html
  @column_widths = options[:column_widths]
  #{style:'border:1px solid red;'}
  tag 'table' do
    tag 'tbody' do
      rows.each do |row|
        add_row row, :headed => options[:headed]
      end
      block.arity<1 ? self.instance_eval(&block) : block.call(self) if block_given?
    end
  end
end