关于横向循环
如果有10个数据的话
我想实现里面的 表格每行显示4个,。
然后在向下循环
请问怎么实现啊
<table width= "44% " border= "0 ">
<tr>
<td>
<br>
<table width= "120 " border= "0 ">
<tr>
<td width= "120 " height= "98 " align= "center " valign= "middle " bgcolor= "#F4F4F4 " class= "centbodyfont "> <img src= "images/2wj-1.jpg " width= "110 " height= "83 "> </td>
</tr>
<tr>
<td height= "20 "> asdasd </td>
</tr>
</table>
<br>
</td>
</tr>
</table>
------解决方案--------------------for(int i = 0;i <=10;i++)
{
out.println( " <tr> <td> " +i + " </td> ");
if(i != 0 && i%4 == 0)
out.println( " </tr> ");
}
------解决方案--------------------out.println( " <tr> ");
for(int i = 0;i <=10;i++)
{
out.println( " <td> " +i + " </td> ");
if(i != 0 && i%4 == 0)
out.println( " </tr> \n <tr> ");
}