我在新闻页面中做了个新闻标题的显示表格,数据库有多少都是挤在一行里边,想让他在一行显示5个标题然后转到第二行,现在显示的结果是:
理想的效果是:
现在的表格代码是:
<table width="710" height="99" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="220" align="center" valign="top"><%
TypeNumber=Trim(Replace(Request("TypeNumber"),"","'"))
if TypeNumber="" then
sql="select * from news where typeNumber='00040001' order by id desc"
else
sql="select * from news where TypeNumber='"&TypeNumber&"' order by id desc"
end if
rs.Open Sql,conn,1,1
if rs.recordcount=0 then
%>
<table width="200" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td id="hei" align="center">ÔÝÎÞÐÅÏ¢</td>
</tr>
</table>
<%
else
Run=Rs.RecordCount
%>
<table width="720" border="0" cellpadding="0" cellspacing="0">
<tr>
<%
rs.pagesize=18
rs.absolutepage=1
if request.QueryString("page")<>"" then rs.absolutepage=trim(request.QueryString("page"))
dim rowcount
rowcount=rs.pagesize
j=1
k=1
%>
<td align="center" valign="top">
<table width="722" border="0" cellspacing="0" cellpadding="0" id="hei">
<tr><%do while not rs.eof and j<=rs.pagesize
%>
<td width="26" height="24" align="center" valign="middle"><img src="img/29.jpg"></td>
<td width="166" align="left" valign="middle"><a href="newsx.asp?id=<%=rs("id")%>" target="_blank"><%=rs("title")%></a></td>
<%
k=k+1
rs.movenext
j=j+1
loop
%>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
</tr>
</table>
<br />
<%
end if
rs.close
%></td>
</tr>
</table>