84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
我在某table里用<s:iterator>显示某List的内容,想每行显示四个td,写了如下代码:
<s:if test="!(#st.index % 4)"><tr></s:if> 某些td代码 <s:if test="!(#st.index % 4)"></tr></s:if>
结果显示错乱,有的行显示一个td,有的显示3个。怎么才能按照我的想法显示?
学习是最好的投资!
Isn’t this okay?
<s:iterator value="#list" id="obj"> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </s:iterator>
<s:iterator> <s:if test="(#st.index % 4) == 0 && (#st.index != 0)"> </tr> <tr> </s:if> <s:elseif test="#st.index == 0"> <tr> </s:elseif> </s:iterator>
The problem is solved, you should put:
<s:if test="(#st.index % 4) == 0 && (#st.index != 0)"> </tr> <tr> </s:if> <s:elseif test="#st.index == 0"> <tr> </s:elseif>
Isn’t this okay?
The problem is solved, you should put:
between the <s:iterator> and </s:iterator> tags