From: Raveendran Jazzez Date: 2008-07-16T19:16:02+09:00 Subject: Re: autogenrated table > babu nair wrote: >> Please can any one for auto generated table,tr,td according to the query >> result. >> for ex: >> columns:7 >> query size:3 >> >> it should generate 7 and 3 > HI Babu, May be thiese lines helpful for u. CODE: class Table def open_table print "" end def close_table print "
\n" end def open_tr print "" end def close_tr print "" end def open_td print "" end def close_td print "" end def create_row(number) open_table number.times do open_tr close_tr end close_table end def create_column(number) open_table number.times do open_td close_td end close_table end end t=Table.new print t.create_row(2) print t.create_column(2) Regards, P.Raveendran http://raveendran.wordpress.com -- Posted via http://www.ruby-forum.com/.