Module: Taka::DOM::HTML::TableSectionElement
- Defined in:
- lib/taka/dom/html/table_section_element.rb
Instance Method Summary collapse
- #ch ⇒ Object
- #chOff ⇒ Object
- #deleteRow(index) ⇒ Object
- #insertRow(index) ⇒ Object
- #rowIndex ⇒ Object
- #rows ⇒ Object
Instance Method Details
#ch ⇒ Object
40 41 42 |
# File 'lib/taka/dom/html/table_section_element.rb', line 40 def ch self['char'] end |
#chOff ⇒ Object
44 45 46 |
# File 'lib/taka/dom/html/table_section_element.rb', line 44 def chOff self['charoff'] end |
#deleteRow(index) ⇒ Object
36 37 38 |
# File 'lib/taka/dom/html/table_section_element.rb', line 36 def deleteRow index (row = rows[index]) && row.unlink end |
#insertRow(index) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/taka/dom/html/table_section_element.rb', line 23 def insertRow index tr = Nokogiri::XML::Node.new('tr', self.document) sibling = rows[index] if !sibling self.add_child tr else sibling.add_previous_sibling tr end tr end |
#rowIndex ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/taka/dom/html/table_section_element.rb', line 5 def rowIndex parent_table = self.parent while parent_table.name != 'table' parent_table = parent_table.parent end parent_table.rows.each_with_index do |row, i| return i if row == self end raise end |