如何解决这个html表格左对齐问题
以下是我为html表设置值的方式:如何解决这个html表格左对齐问题,html,jsp,Html,Jsp,以下是我为html表设置值的方式: <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#f9fae3" align="center" > <tr class='lightrow'> &
<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 = " ";
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"> </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>
美国号
员工编号
名称
卡号
发布
地位
0){
htmltablestatus=1;
int i=0;
for(int iterator=0;iterator
要调整页码之间的间距,您必须为显示页码的表格设置表格或列的宽度。代码不足以解决您的问题。请查看我的编辑尝试根据需要向每个td或tr添加类,并使用该类的css,以获得所需的外观