编写如下代码
<table width="900" align="center" cellspacing="0">
<tr>
<td colspan="3"><jsp:include page="public/top.jsp"/></td>
</tr>
<tr>
<td colspan="3"><jsp:include page="public/menu.jsp"/></td>
</tr>
</table>
可是窗口却显示如下界面就是top.jsp和menu.jsp之间按道理没有间隙的 可是我的两个页面并没有连在一起而是分开了(那中间白色的就是分开的部分)
怎么才能去掉那中间白色的哦
<table width="900" align="center" cellspacing="0">
<tr>
<td colspan="3"><jsp:include page="public/top.jsp"/></td>
</tr>
<tr>
<td colspan="3"><jsp:include page="public/menu.jsp"/></td>
</tr>
</table>
可是窗口却显示如下界面就是top.jsp和menu.jsp之间按道理没有间隙的 可是我的两个页面并没有连在一起而是分开了(那中间白色的就是分开的部分)
怎么才能去掉那中间白色的哦
<tr>
<td colspan="3"><div> <jsp:include page="public/top.jsp"/></div> </td>
</tr>
<tr>
<td colspan="3"><div> <jsp:include page="public/menu.jsp"/> </div></td>
</tr>
</table>
<%@ page language="java" import="java.sql.*,java.util.*;" contentType="text/html; charset=GB2312"%>
<%@ include file="conn.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head>
<body>
<table width="900" align="center" cellspacing="0" bordercolor="#999999">
<!--DWLayoutTable-->
<tr>
<td width="900" height="36" valign="top"><table width="100%" cellspacing="0">
<tr>
<td align="right" valign="top"></td>
<td align="right" valign="top"><table width="900" cellspacing="0" bgcolor="#ff8040">
<tr>
<%
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=teach";
conn=DriverManager.getConnection(url,"sa","");//建立与数据库的连接
stmt=conn.createStatement();
sql="select * from tb_Menu";
rs=stmt.executeQuery(sql);//查询数据库
while(rs.next()){
%>
<td width="120" align="right" valign="top">
<a href="<%=rs.getString(3)%>">
<%=rs.getObject(2)%></a></td>
<td width="80" align="right" valign="top"> </td>
<%
}
rs.close();
stmt.close();
conn.close();
}catch(Exception e){
out.println(e);
}
%>
</tr>
<tr>
</table></td>
<td valign="top"></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<%
out.clear();
%>
就可以了。
你在top.jsp和menu.jsp的<body>标签和<form>标签中都加入如下样式代码
style="margin-top:0px;margin-bottom:0px;"
再试试看,这个可能是你top.jsp和menu.jsp中的body或者form的margin问题
<%
out.clear();
%>这样么?? 没用呐 还是老样子