asp能否控制表格的行数,高人指点下。(已解决)
我想实现每页的表格行数都30行,不管当前页的记录数是否够30条。一条记录一行,不够30条的自动补够30行。。。
高人指点下啊。。。这样的效果能否实现啊?
[[italic] 本帖最后由 letla 于 2007-12-27 09:38 编辑 [/italic]]
<%sql="select * from info order by time desc" set rs= Server.CreateObject("ADODB.Recordset") rs.open sql,conn,3,3%> <table id="newstable" style="DISPLAY: block" cellspacing="0" cellpadding="0" width="214" align="center" border="0"> <tbody> <tr> <td class="txtcolor" colspan="2" height="4"></td> </tr> <%if rs.recordcount<6 then for i=1 to rs.recordcount%> <tr> <td class="txtcolor" align="middle" width="14" height="26"><img src="jhd/left.gif" border="0"></td> <td><a href="view_info.asp?id=<%=rs("id")%>" target="_blank" class="txtcolor"> <% If Len(rs("title"))>20 Then Response.Write Leftb(rs("title"),20) & "…" Else Response.Write rs("title") End If%> </a></td> </tr> <tr> <td background="jhd/legend.gif" colspan="2" height="1"></td> </tr> <%rs.movenext%> <%next%> <%for j=1 to 6-rs.recordcount%> <tr><td class="txtcolor" align="middle" width="14" height="26"><img src="jhd/left.gif" border="0"></td> <td class="txtcolor"></td> </tr> <tr> <td background="jhd/legend.gif" colspan="2" height="1"></td> </tr> <%next%> <%else for i=1 to 6%> <tr> <td class="txtcolor" align="middle" width="14" height="26"><img src="jhd/left.gif" border="0"></td> <td><a href="view_info.asp?id=<%=rs("id")%>" target="_blank" class="txtcolor"> <% If Len(rs("title"))>20 Then Response.Write Leftb(rs("title"),20) & "…" Else Response.Write rs("title") End If%> </a></td> </tr> <tr> <td background="jhd/legend.gif" colspan="2" height="1"></td> </tr> <%rs.movenext%> <%next end if %> </tbody> </table> </tr> </tbody> </table></td> </tr> </tbody> </table>