View Single Post
  #2 (permalink)  
Old 05-16-2008, 06:44 PM
ShoeNinja's Avatar
ShoeNinja ShoeNinja is offline
Senior Member
 
Join Date: Oct 2007
Posts: 112
ShoeNinja is on a distinguished road
Send a message via AIM to ShoeNinja
I think you're right. The problem is in your if condition.

Code:
for(int i=0;i<list.size();i++){ if(i==0 || i%2==0){ list.set(i,"<tr><td align='center'>"+list.get(i)+"</td>"); }else{ list.set(i,"<td align='center'>"+list.get(i)+"</td></tr>"); } }

I'm not sure why you open your <tr> element when the if is true and close if when it is not.

I think there are some better ways to accomplish what you are going for but it's hard to tell without seeing more code.
Reply With Quote