JSP图片显示页的问题!

时间:2013.11.28 发布人:JDBKGF

JSP图片显示页的问题!

已解决问题

谷歌JDBKGF用户在2013.11.28提交了关于“张玉环孩子JSP图片显示页的问题!”的提问,欢迎大家涌跃发表自己的观点。目前共有1个回答,最后更新于2024-12-25T21:27:00。我现在调出来的图片就是分一列显示,如果改成两列就重复了,大家帮我修改一下呗,就是假如我这个页面从**库中调出8张图片,我想分成两行,每行4个图片,大家给瞧瞧该怎么改呗,谢谢,呵呵!
代码如下!
<%
response.setCharacterEncoding("UTF-8");
DBdb=newDB();
try{
Stringsql="**LECT*FROMimages";
PreparedStatementpstmt=db.pstmt(sql);
ResultSetrs=pstmt.executeQuery();
%>
<center><tableborder="1"width="80%">

<%
while(***.next()){
intid=rs.getInt(1);
Stringname=rs.getString(2);
Stringphoto=rs.getString(3);
%>
<tr>
<td>
<ahref=listphoto.jsp?id=<%=id%>><imgsrc="upload/<%=photo%>"width="100"height="100"></a>
</td>
</tr>
<%
}
%>
</table></center>
<%
pstmt.close();
}catch(Exceptione){}
%>希望大家能够帮助她。

详细问题描述及疑问:我现在调出来的图片就是分一列显示,如果改成两列就重复了,大家帮我修改一下呗,就是假如我这个页面从**库中调出8张图片,我想分成两行,每行4个图片,大家给瞧瞧该怎么改呗,谢谢,呵呵!
代码如下!
<%
response.setCharacterEncoding("UTF-8");
DBdb=newDB();
try{
Stringsql="**LECT*FROMimages";
PreparedStatementpstmt=db.pstmt(sql);
ResultSetrs=pstmt.executeQuery();
%>
<center><tableborder="1"width="80%">

<%
while(***.next()){
intid=rs.getInt(1);
Stringname=rs.getString(2);
Stringphoto=rs.getString(3);
%>
<tr>
<td>
<ahref=listphoto.jsp?id=<%=id%>><imgsrc="upload/<%=photo%>"width="100"height="100"></a>
</td>
</tr>
<%
}
%>
</table></center>
<%
pstmt.close();
}catch(Exceptione){}
%>期待您的答案,感谢你,我会记得你对我的好的 !

希望以下的回答,能够帮助你。

第1个回答

用户名:lcl123766234  

<%
response.setCharacterEnco搞年色妒照散息ding("UTF-8");
DBdb=newDB();
try{
Stringsql="**LECT*FROMimages";
PreparedStatementpstmt=db.pstmt(sql);
ResultSetrs=pstmt.executeQuery();
%>
<center><tableborder="1"width="80%"><tr>

<%
int**mber=0;
while(***.next()){
if(**mber%4==0)out.println("</t教重慢规r><tr>");
**mbe跑r++;
intid=rs.getInt(1);
掉毫Stringname=rs.getString(2);
Stringphot好临第丰龙烟事o=rs.getStrin孩够增g(3);
%>

<td>
<ahref=listphoto.jsp?id=<%=id%>><imgsrc="upload/<%=photo%>"width="100"height="100"></a>
</td>

<%
}
%>
</t异植路斯果三交越纸r></table></c胜货括就汉片脸有enter>
<%
pstmt.灯做贵年溶航屋close();
}catch(Exceptione){}
%>

报你满意