I think you're right. The problem is in your if condition.
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.