Class: MathML::Table

Inherits:
Element show all
Defined in:
lib/math_ml.rb

Instance Attribute Summary

Attributes inherited from Element

#display_style

Instance Method Summary collapse

Methods inherited from Element

#<<, #as_display_style

Methods inherited from XMLElement

#pop

Constructor Details

#initializeTable

Returns a new instance of Table.



222
223
224
# File 'lib/math_ml.rb', line 222

def initialize
	super("mtable")
end

Instance Method Details

#aligns=(a) ⇒ Object



242
243
244
# File 'lib/math_ml.rb', line 242

def aligns=(a)
	set_align_attribute("columnalign", a, Align::CENTER)
end

#hlines=(a) ⇒ Object



250
251
252
# File 'lib/math_ml.rb', line 250

def hlines=(a)
	set_align_attribute("rowlines", a, Line::NONE)
end

#set_align_attribute(name, a, default) ⇒ Object



226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/math_ml.rb', line 226

def set_align_attribute(name, a, default)
	if a.is_a?(Array) && a.size>0
		value = ""
		a.each do |i|
			value << " "+i
		end
		if value =~ /^( #{default})*$/
			@attributes.delete(name)
		else
			@attributes[name] = value.strip
		end
	else
		@attributes.delete(name)
	end
end

#vlines=(a) ⇒ Object



246
247
248
# File 'lib/math_ml.rb', line 246

def vlines=(a)
	set_align_attribute("columnlines", a, Line::NONE)
end