Class Texy::Modules::TableFieldElement
In: lib/texy/modules/table.rb
Parent: TextualElement

Html element td / th

Methods

Attributes

col_span  [RW] 
head  [W] 
row_span  [RW] 

Public Class methods

[Source]

# File lib/texy/modules/table.rb, line 216
            def initialize(texy)
                super
                self.col_span = 1
                self.row_span = 1
            end

Public Instance methods

[Source]

# File lib/texy/modules/table.rb, line 212
            def head?
                @head
            end

Protected Instance methods

[Source]

# File lib/texy/modules/table.rb, line 233
                def generate_content
                    html = super
                    html.empty? ? ' ' : html
                end

[Source]

# File lib/texy/modules/table.rb, line 223
                def generate_tags(tags)
                    self.tag = head? ? 'th' : 'td'

                    super(tags) do |attrs|
                        attrs['colspan'] = col_span.to_s if col_span != 1
                        attrs['rowspan'] = row_span.to_s if row_span != 1
                        attrs
                    end
                end

[Validate]