单击按钮更改表格列标题

发布于 2024-11-04 09:24:17 字数 3276 浏览 0 评论 0原文

<%@include file="/WEB-INF/jsp/include/pagedirectives.jsp"%>

<div style="background: #D6E8FF; padding: 10px;" class="advanced_search">
<%@include file="/WEB-INF/jsp/include/page.topmessagebox.jsp"%>

<table class="form" cellspacing="0" id="requestSubmissionEform">
    <tbody>
        <tr>
            <td class="label"><b>Label</b></td>
            <td class="label" align="left"><b>Form 1</b></td>
            <td class="label" align="left"><b>Form 2</b></td>
            <td class="label" align="left"><b>Form 3</b></td>
            <td class="label" align="left"><b>Form 4</b></td>
            <td class="label" align="left"><b>Form 5</b></td>
        </tr>
        <c:forEach items="${eformDetailsList}" var="eformDetails"
            varStatus="status">

            <tr id="serviceTypeWithEform">
                <td class="label"><label for="${eformDetails.id}_0"><c:out
                    value="${eformDetails.label}" /></label> <input type="hidden"
                    id="label_${eformDetails.id}_0" value="${eformDetails.label}"
                    name="label_0"></input> <input type="hidden"
                    id="index_${eformDetails.id}_0" value="${eformDetails.id}"
                    name="index_0"></input></td>
                <c:if test="${eformDetails.controlType==1}">
                    <td id="Col0" style="visibility: visible;"><input
                        id="eformDetail_${eformDetails.id}_0" class="eformDetail"
                        type="text" value="" name="form_0"></input></td>
                    <td id="Col1" style="visibility: visible;"><input
                        id="eformDetail_${eformDetails.id}_1" class="eformDetail"
                        type="text" value="" name="form_1"></input></td>
                    <td id="Col2" style="visibility: visible;"><input
                        id="eformDetail_${eformDetails.id}_2" class="eformDetail"
                        type="text" value="" name="form_2"></input></td>
                    <td id="Col3" style="visibility: visible;"><input
                        id="eformDetail_${eformDetails.id}_3" class="eformDetail"
                        type="text" value="" name="form_3"></input></td>
                    <td id="Col4" style="visibility: visible;"><input
                        id="eformDetail_${eformDetails.id}_4" class="eformDetail"
                        type="text" value="" name="form_4"></input></td>
                </c:if>
            </tr>

        </c:forEach>
        <c:if test="${empty eformDetailsList}">
            <tr id="serviceTypeWithNoEform">
                <td><b>There is no eform associated with this Service Type</b></td>
            </tr>
        </c:if>

    </tbody>
</table>

此页面将有 2 个按钮(上一页和下一页)。单击“下一步”时,我想将列标题更改为 6、7、8、9、10 等形式,以便进一步单击。请帮忙!

<%@include file="/WEB-INF/jsp/include/pagedirectives.jsp"%>

<div style="background: #D6E8FF; padding: 10px;" class="advanced_search">
<%@include file="/WEB-INF/jsp/include/page.topmessagebox.jsp"%>

<table class="form" cellspacing="0" id="requestSubmissionEform">
    <tbody>
        <tr>
            <td class="label"><b>Label</b></td>
            <td class="label" align="left"><b>Form 1</b></td>
            <td class="label" align="left"><b>Form 2</b></td>
            <td class="label" align="left"><b>Form 3</b></td>
            <td class="label" align="left"><b>Form 4</b></td>
            <td class="label" align="left"><b>Form 5</b></td>
        </tr>
        <c:forEach items="${eformDetailsList}" var="eformDetails"
            varStatus="status">

            <tr id="serviceTypeWithEform">
                <td class="label"><label for="${eformDetails.id}_0"><c:out
                    value="${eformDetails.label}" /></label> <input type="hidden"
                    id="label_${eformDetails.id}_0" value="${eformDetails.label}"
                    name="label_0"></input> <input type="hidden"
                    id="index_${eformDetails.id}_0" value="${eformDetails.id}"
                    name="index_0"></input></td>
                <c:if test="${eformDetails.controlType==1}">
                    <td id="Col0" style="visibility: visible;"><input
                        id="eformDetail_${eformDetails.id}_0" class="eformDetail"
                        type="text" value="" name="form_0"></input></td>
                    <td id="Col1" style="visibility: visible;"><input
                        id="eformDetail_${eformDetails.id}_1" class="eformDetail"
                        type="text" value="" name="form_1"></input></td>
                    <td id="Col2" style="visibility: visible;"><input
                        id="eformDetail_${eformDetails.id}_2" class="eformDetail"
                        type="text" value="" name="form_2"></input></td>
                    <td id="Col3" style="visibility: visible;"><input
                        id="eformDetail_${eformDetails.id}_3" class="eformDetail"
                        type="text" value="" name="form_3"></input></td>
                    <td id="Col4" style="visibility: visible;"><input
                        id="eformDetail_${eformDetails.id}_4" class="eformDetail"
                        type="text" value="" name="form_4"></input></td>
                </c:if>
            </tr>

        </c:forEach>
        <c:if test="${empty eformDetailsList}">
            <tr id="serviceTypeWithNoEform">
                <td><b>There is no eform associated with this Service Type</b></td>
            </tr>
        </c:if>

    </tbody>
</table>

this page will have 2 buttons (prev. and next). on click of next i want to change column headings to form 6,7,8,9,10 and so on for further clicks. please help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

醉生梦死 2024-11-11 09:24:17

只需根据当前页面动态打印它们,从页面索引 0 开始。按每一个下一个按钮,页面索引

<tr>
    <th>Label</th>
    <th>Form ${(page * 5) + 1}</th>
    <th>Form ${(page * 5) + 2}</th>
    <th>Form ${(page * 5) + 3}</th>
    <th>Form ${(page * 5) + 4}</th>
    <th>Form ${(page * 5) + 5}</th>
</tr>

就会增加 1。(请注意,表格标题单元格将由,不是

Just print them dynamically depending on the current page, starting with page index 0. On every next button press increment the page index by 1.

<tr>
    <th>Label</th>
    <th>Form ${(page * 5) + 1}</th>
    <th>Form ${(page * 5) + 2}</th>
    <th>Form ${(page * 5) + 3}</th>
    <th>Form ${(page * 5) + 4}</th>
    <th>Form ${(page * 5) + 5}</th>
</tr>

(please note that table header cells are to be represented by <th>, not by <td>)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文