Class: Wizport::Html::Table
- Defined in:
- lib/wizport/document/html/table.rb
Constant Summary collapse
- DEFAULT_COLUMN_WIDTH =
40
Instance Method Summary collapse
-
#initialize(html, rows = [], options = {}, &block) ⇒ Table
constructor
A new instance of Table.
Methods inherited from Element
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 = [], = {}, &block) super html @column_widths = [:column_widths] #{style:'border:1px solid red;'} tag 'table' do tag 'tbody' do rows.each do |row| add_row row, :headed => [:headed] end block.arity<1 ? self.instance_eval(&block) : block.call(self) if block_given? end end end |