class SiSU_XHTML_Table::TableXHTML
Public Class Methods
new(table)
click to toggle source
# File lib/sisu/xhtml_table.rb, line 60 def initialize(table) @table_obj=table end
Public Instance Methods
table()
click to toggle source
# File lib/sisu/xhtml_table.rb, line 63 def table table_obj=@table_obj if table_obj.obj !~/^<table\s/m table_obj=table_rows_and_columns_array(table_obj) else p __LINE__; p caller end table_obj end
table_rows_and_columns_array(table_obj)
click to toggle source
# File lib/sisu/xhtml_table.rb, line 71 def table_rows_and_columns_array(table_obj) # provides basic (x)html table table_rows,nr=[],0 table_obj.obj.split(Mx[:tc_c]).each do |table_row| table_row_with_columns=table_row.split(Mx[:tc_p]) trc,nc=[],0 table_row_with_columns.each do |c| c=c.gsub(/^~$/,''). # tilde / empty cell gsub(/<:br>/,the_line_break) trc <<= if table_obj.head_ and nr==0; %{<th width="#{table_obj.widths[nc]}%">#{c}</th>} else %{<td width="#{table_obj.widths[nc]}%">#{c}</td>} end nc+=1 end trc=(trc.is_a?(Array)) ? trc.flatten.join : trc trc=" <tr>#{trc}</tr>\n" nr+=1 table_rows << trc end table_rows=table_rows.flatten.join table_obj.obj=%{<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">\n#{table_rows} </table>} table_obj end