0

这就是我为 html 表设置值的方式:

<table  width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#f9fae3" align="center" >
                                                <tr class='lightrow'>
                                                  <td width="12%" class="title_sub" align="center" >S.No</td>
                                                  <td width="12%" class="title_sub" align="left">EmployeeID</td>
                                                  <td width="32%" class="title_sub" align="left">Name</td>
                                                  <td width="20%" class="title_sub" align="left">Cardnumber</td>
                                                  <td width="12%" class="title_sub" align="left">Issued</td>
                                                  <td width="12%" class="title_sub" align="left">Status</td>
                                                </tr>
                                            </table>
                                            <%
                                            TempcardViewModel temporaycardDetails=null;
                                             String classname = "darkrow", noresults = "No Records Found ", space = "&nbsp;";
                                             int sno = 1,htmltablestatus = 0;
                                             String[] colorArray = {"lightrow","darkrow"};
                                             if(tempcardList.size() >0){
                                                 htmltablestatus = 1;
                                                 int i =0;
                                                 for (int iterator=0; iterator < tempcardList.size(); iterator++)
                                                    {
                                                     if(i == 0)  i = 1;
                                                        else i = 0;
                                                        classname = colorArray[i];
                                                        temporaycardDetails=(TempcardViewModel)tempcardList.get(iterator);
                                            %>
                                            <table  width='100%' align='center' border='0' cellpadding='0' cellspacing='0'>
                                                <tr class='<%=classname%>'>
                                                    <td width="12%" align="center" ><%=sno%></td>
                                                    <td width="12%" align="left"><%=temporaycardDetails.getEmpid()%></td>
                                                    <td width="32%" align="left"><%=temporaycardDetails.getEmpname()%></td>
                                                    <td width="20%" align="left"><%=temporaycardDetails.getTempcardnumber()%></td>
                                                    <td width="12%" align="left"><%=temporaycardDetails.getIssuedate()%></td>
                                                    <td width="12%" align="left"><%=temporaycardDetails.getTempcardstatus()%></td>
                                                </tr>
                                            <tr>
                                                <td colspan="6">&nbsp;</td>
                                            </tr>
                                           <% sno++;}//end of for loop 
                                             } // end of if loop
                                           %>
                                           </table>
                                                    <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFF0">
                                                        <tr >
                                                        <% if(currentPage != 1){
                                                            currentPage=currentPage - 1;
                                                        %>
                                                                <td align="left" ><a href="#" onclick="gotoPage('<%=currentPage%>')">Previous</a></td>
                                                           <%}
                                                        for(int i=1;i<=noOfPages;i++){
                                                            if(currentPage==i){
                                                        %>
                                                            <td>${i}</td><% } else {%>
                                                                    <td align="left" ><a href="#" onclick="gotoPage('<%=i%>')"><%=i%></a></td>
                                                                <% }%>
                                                        <%} %>
                                                        <% if(currentPage < noOfPages){
                                                            currentPage=currentPage + 1;
                                                        %>
                                                                <td align="left" ><a href="#" onclick="gotoPage('<%=currentPage%>')">Next</a></td>
                                                           <%}%>
                                                        </tr>
                                                    </table>

我已经为jsp页面中的分页做了这个。但它给了我结果我面临的问题是数字显示如下:(1 2 3 4 5 6 Next每个数字之间有很大的空间)

但我希望它们显示为1 2 3 4 5 6 7 next

谢谢并恭祝安康

4

1 回答 1

1

要调整页码之间的间距,您必须为显示页码的表格设置表格或列的宽度。

于 2012-08-09T12:14:22.173 回答