xrcwrn
xrcwrn

Reputation: 5337

<s:iterator> Displaying three names in each row

Here i am iterating over a searched user list which is working properly. I am trying to display three user in each row like

u1   u2   u3
u4   u5   u6
     ..
     ..

This code showing one username in each row. i have to show as above

<s:iterator var="searchedUser" value="searchedUserList">
    <tr><td>
       <s:property value="UserName"/>
    </td></tr>
</s:iterator>

Upvotes: 0

Views: 4711

Answers (1)

Jaiwo99
Jaiwo99

Reputation: 10017

here is the code:

<table>
    <s:iterator value="{1,2,3,4,5,6,7,8,9}" status="status">
        <s:if test="%{#status.index == 0}"><tr><td><s:property /></td></s:if>
            <s:elseif test="%{#status.index%3 == 0}">
            </tr><tr><td><s:property /></td>
            </s:elseif>
            <s:else>
                <td><s:property /></td>
            </s:else>
        </s:iterator>
    </tr>
</table>

Upvotes: 1

Related Questions