首页上一页 1 下一页尾页 3 条记录 1/1页
java 项目全程开发实录中第九章 产品展示链接中如何三行三列显示
发表在Java图书答疑
2014-11-10
是否精华
是
否
版块置顶:
是
否
<table id="__01" width="1025" height="819" border="0" cellpadding="0" cellspacing="0">
<tr>
<td rowspan="6">
<img src="images/cpjs/9.gif" width="108" height="819" alt=""></td>
<td colspan="2">
<img src="images/cpjs/1.gif" alt="" width="778" height="62" border="0" usemap="#Map4"></td>
<td rowspan="6">
<img src="images/cpjs/2.gif" width="138" height="819" alt=""></td>
<td>
<img src="images/分隔符.gif" width="1" height="62" alt=""></td>
</tr>
<tr>
<td rowspan="2">
<img src="images/cpjs/3.gif" alt="" width="235" height="271" border="0" usemap="#Map2"></td>
<td>
<img src="images/cpjs/4.gif" alt="" width="543" height="255" border="0" usemap="#Map3"></td>
<td>
<img src="images/分隔符.gif" width="1" height="255" alt=""></td>
</tr>
<tr>
<td rowspan="2" width="543" height="339" background="images/cpjs/5.gif" class="zczi">
<!-- 分栏显示 -->
<%
//int RowCount = sql.selectCountBusiness();//记录数
int col=1; // 控制产品介绍栏显示两列产品图标和文本
int RowCount=6;
ResultSet Rs = sql.selectbusiness();
int HRow = RowCount/2;//行数
if (RowCount%2>0)
HRow++;
for (int i = 0 ;i<HRow;i++){%>
<%
for (int j=i*2+1;j<=(i+1)*2;j++){
Rs.absolute(j);
if (Rs.isAfterLast())
break;
%>
<a href='#' onclick=window.open('houtai/productview.jsp?catid=<%=Rs.getString(1)%>','newwindow','width=600,height=350,top=300,left=300')><img src="images/spimg/<%=Rs.getString("img")%>" width="70" height="70"></a> <a href='#' onclick=window.open('houtai/productview.jsp?catid=<%=Rs.getString(1)%>','newwindow','width=600,height=350,top=300,left=300')><%=Rs.getString("name")%></a>
<%
if (col % 2 == 0){
out.println("<br>");
}
col++;
%>
<%}%>
<%}%>
</td>
<td>
<img src="images/分隔符.gif" width="1" height="16" alt=""></td>
</tr>
<tr>
<td rowspan="2"> <img src="images/cpjs/6.gif" width="235" height="417" alt=""></td>
<td>
<img src="images/分隔符.gif" width="1" height="323" alt=""></td>
</tr>
<tr>
<td>
<img src="images/cpjs/7.gif" alt="" width="543" height="94" border="0" usemap="#Map" onclick=window.open('houtai/productBrowse.jsp') class='zczi'></td>
<td>
<img src="images/分隔符.gif" width="1" height="94" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img src="images/cpjs/8.gif" width="778" height="69" alt=""></td>
<td>
<img src="images/分隔符.gif" width="1" height="69" alt=""></td>
</tr>
</table>
<tr>
<td rowspan="6">
<img src="images/cpjs/9.gif" width="108" height="819" alt=""></td>
<td colspan="2">
<img src="images/cpjs/1.gif" alt="" width="778" height="62" border="0" usemap="#Map4"></td>
<td rowspan="6">
<img src="images/cpjs/2.gif" width="138" height="819" alt=""></td>
<td>
<img src="images/分隔符.gif" width="1" height="62" alt=""></td>
</tr>
<tr>
<td rowspan="2">
<img src="images/cpjs/3.gif" alt="" width="235" height="271" border="0" usemap="#Map2"></td>
<td>
<img src="images/cpjs/4.gif" alt="" width="543" height="255" border="0" usemap="#Map3"></td>
<td>
<img src="images/分隔符.gif" width="1" height="255" alt=""></td>
</tr>
<tr>
<td rowspan="2" width="543" height="339" background="images/cpjs/5.gif" class="zczi">
<!-- 分栏显示 -->
<%
//int RowCount = sql.selectCountBusiness();//记录数
int col=1; // 控制产品介绍栏显示两列产品图标和文本
int RowCount=6;
ResultSet Rs = sql.selectbusiness();
int HRow = RowCount/2;//行数
if (RowCount%2>0)
HRow++;
for (int i = 0 ;i<HRow;i++){%>
<%
for (int j=i*2+1;j<=(i+1)*2;j++){
Rs.absolute(j);
if (Rs.isAfterLast())
break;
%>
<a href='#' onclick=window.open('houtai/productview.jsp?catid=<%=Rs.getString(1)%>','newwindow','width=600,height=350,top=300,left=300')><img src="images/spimg/<%=Rs.getString("img")%>" width="70" height="70"></a> <a href='#' onclick=window.open('houtai/productview.jsp?catid=<%=Rs.getString(1)%>','newwindow','width=600,height=350,top=300,left=300')><%=Rs.getString("name")%></a>
<%
if (col % 2 == 0){
out.println("<br>");
}
col++;
%>
<%}%>
<%}%>
</td>
<td>
<img src="images/分隔符.gif" width="1" height="16" alt=""></td>
</tr>
<tr>
<td rowspan="2"> <img src="images/cpjs/6.gif" width="235" height="417" alt=""></td>
<td>
<img src="images/分隔符.gif" width="1" height="323" alt=""></td>
</tr>
<tr>
<td>
<img src="images/cpjs/7.gif" alt="" width="543" height="94" border="0" usemap="#Map" onclick=window.open('houtai/productBrowse.jsp') class='zczi'></td>
<td>
<img src="images/分隔符.gif" width="1" height="94" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img src="images/cpjs/8.gif" width="778" height="69" alt=""></td>
<td>
<img src="images/分隔符.gif" width="1" height="69" alt=""></td>
</tr>
</table>