jsp表格问题
<%@ page import= "java.util.Vector " %>
<%@ page import= "mq.model.gong " %>
<%@ include file= "Taglibs.jsp " %>
<html>
<HEAD>
<head>
<STYLE type=text/css>
TD {
FONT-SIZE: 13px
}
</style>
</head>
<TITLE>
<bean:message key= "index.title "/>
</TITLE>
</HEAD>
<body>
<table width= "170 " border= "0 " align= "left " cellpadding= "0 " cellspacing= "0 " >
<tr>
<td width= "167 " rowspan= "3 " vAlign=top height= "271 " background= "images/ggl.gif ">
<DIV align= "left ">
<P>
<br>
<br>
<br>
</P>
<table width= "170 " height= "104 " border= "0 " cellspacing= "0 " cellpadding= "0 " >
<%
Vector vs = (Vector)request.getAttribute( "gong ");
for(int i=0;i <vs.size();i++)
{
gong go = (gong)vs.elementAt(i);
System.out.println(vs.size());
%>
<tr>
</td width= "100% " align= "center ">
 
<img src= "images/bj321.gif "/>
<a href=display.do?id= <%=go.getId()%> target= "_blank "> <%=go.getTitle()%> </a>
</TD>
</tr>
<%
}
%>
</table>
</DIV>
</td>
</tr>
<tr>
<TD align= "center " valign= "top " width= "100% ">
<TABLE border= "0 " >
<tr>
<td>
这一行
</td>
</tr>
</TABLE>
</TD>
</tr>
</table>
</body>
</html>
问下为什么最后的一行
内容是“这一行”
会出现在中间而不是按我要的求出现在左边也就是上面的那一行的下面呢?
[解决办法]
<TD align= "center " valign= "top " width= "100% ">
<TABLE border= "0 " >
<tr>
<td>
这一行
</td>
</tr>
</TABLE>
</TD>
TD的里面包含一个table,而TD的属性align= "center ",所以就限制了table在中间。
要想不在中间可以去掉这个属性或者改为left.