
asp 高手请进 急急急急急!!!!
各位帮个忙啊怎么实现读出信息横向排列给你们看看我的代码吧FunctionF_news_more(c1,c2,c3,ss,p,hg,t)IFt=""thenexitFunc...
各位 帮个忙 啊 怎么实现读出信息横向排列
给你们看看我的代码吧
Function F_news_more(c1,c2,c3,ss,p,hg,t)
IF t="" then exit Function
If Not IsObject(Conn) or Conn Is NoThing Then dblink
Dim c,typeData,TempText,MaxperPage,Page,DataCount,DataPage,ii,temp,s
IF c1=0 then
c=""
elseIF c3>0 then
c=" and city_oneid="&c1&" and city_twoid="&c2&" and city_threeid="&c3
elseIF c2>0 then
c=" and city_oneid="&c1&" and city_twoid="&c2
Else
c=" and city_oneid="&c1
End IF
Set Rs=Conn.Execute("Select adid,[color],[title],[date],cu,hits,text,city_one From News_Data Where [type]='"&t&"' "&c&" order by [top] desc,adid desc")
IF Not Rs.Eof Then typeData=Rs.Getrows
CloseConn
IF IsArray(typeData) Then
TempText="<table width=""100%"" border=0 cellpadding=0 cellspacing=0>"
MaxperPage=ss
Page=Strint(Request("Page"))
IF Page=0 Then Page=1
DataCount=Ubound(TypeData,2)+1
IF MaxperPage>=DataCount Then
DataPage=1
Else
DataPage=DataCount\MaxperPage
IF DataCount/MaxperPage<>DataPage Then DataPage=DataPage+1
End IF
IF DataCount>=MaxperPage*Page Then
s=MaxperPage*Page-1
Else
s=DataCount-1
End IF
IF s<1 Then s=0
For ii=MaxperPage*(Page-1) To s
TempText=TempText&"<tr height=""35px"">"
Temp="<td width=""10%"" align=""center"" style=""border-bottom:1px dotted #E1E1E1;"">"&TypeData(7,ii)&"</td><td width=""40%"" style=""border-bottom:1px dotted #E1E1E1;"">·<a href=""news.asp?id="&TypeData(0,ii)&"""><b>"&TypeData(2,ii)&"</b></a></td><td width=""30%"" style=""border-bottom:1px dotted #E1E1E1;"">"&left(TypeData(6,ii),30)&"</td>"
IF TypeData(4,ii)="yes" Then Temp=""&Temp&""
TempText=TempText&Temp&"<td style=""border-bottom:1px dotted #E1E1E1;"">"&TypeData(3,ii)&"</td><td style=""border-bottom:1px dotted #E1E1E1;"">"&TypeData(5,ii)&"</td></tr>"
Next
IF DataCount>MaxperPage Then
TempText=TempText&"<tr align=center><td colspan=3>页数:"&Page&"/"&DataPage
If Page>1 Then TempText=TempText&" <a href=news_more.asp?News="&t&">首页</a> <a href=news_more.asp?Page="&Page-1&"&News="&t&">上一页</a>"
If Page<DataPage Then TempText=TempText&" <a href=news_more.asp?Page="&Page+1&"&News="&t&">下一页</a> <a href=news_more.asp?Page="&DataPage&"&News="&t&">尾页</a>"
TempText=TempText&" 共有 "&DataCount&" 条信息</td></tr>"
End If
TempText=TempText&"</table>"
Else
TempText="<div align=center>暂无"&t&"类企业</div>"
End IF
F_news_more=TempText
End Function
这个程序 现在读出来的就一列往下排 我想让他排3列 各位帮帮忙 展开
给你们看看我的代码吧
Function F_news_more(c1,c2,c3,ss,p,hg,t)
IF t="" then exit Function
If Not IsObject(Conn) or Conn Is NoThing Then dblink
Dim c,typeData,TempText,MaxperPage,Page,DataCount,DataPage,ii,temp,s
IF c1=0 then
c=""
elseIF c3>0 then
c=" and city_oneid="&c1&" and city_twoid="&c2&" and city_threeid="&c3
elseIF c2>0 then
c=" and city_oneid="&c1&" and city_twoid="&c2
Else
c=" and city_oneid="&c1
End IF
Set Rs=Conn.Execute("Select adid,[color],[title],[date],cu,hits,text,city_one From News_Data Where [type]='"&t&"' "&c&" order by [top] desc,adid desc")
IF Not Rs.Eof Then typeData=Rs.Getrows
CloseConn
IF IsArray(typeData) Then
TempText="<table width=""100%"" border=0 cellpadding=0 cellspacing=0>"
MaxperPage=ss
Page=Strint(Request("Page"))
IF Page=0 Then Page=1
DataCount=Ubound(TypeData,2)+1
IF MaxperPage>=DataCount Then
DataPage=1
Else
DataPage=DataCount\MaxperPage
IF DataCount/MaxperPage<>DataPage Then DataPage=DataPage+1
End IF
IF DataCount>=MaxperPage*Page Then
s=MaxperPage*Page-1
Else
s=DataCount-1
End IF
IF s<1 Then s=0
For ii=MaxperPage*(Page-1) To s
TempText=TempText&"<tr height=""35px"">"
Temp="<td width=""10%"" align=""center"" style=""border-bottom:1px dotted #E1E1E1;"">"&TypeData(7,ii)&"</td><td width=""40%"" style=""border-bottom:1px dotted #E1E1E1;"">·<a href=""news.asp?id="&TypeData(0,ii)&"""><b>"&TypeData(2,ii)&"</b></a></td><td width=""30%"" style=""border-bottom:1px dotted #E1E1E1;"">"&left(TypeData(6,ii),30)&"</td>"
IF TypeData(4,ii)="yes" Then Temp=""&Temp&""
TempText=TempText&Temp&"<td style=""border-bottom:1px dotted #E1E1E1;"">"&TypeData(3,ii)&"</td><td style=""border-bottom:1px dotted #E1E1E1;"">"&TypeData(5,ii)&"</td></tr>"
Next
IF DataCount>MaxperPage Then
TempText=TempText&"<tr align=center><td colspan=3>页数:"&Page&"/"&DataPage
If Page>1 Then TempText=TempText&" <a href=news_more.asp?News="&t&">首页</a> <a href=news_more.asp?Page="&Page-1&"&News="&t&">上一页</a>"
If Page<DataPage Then TempText=TempText&" <a href=news_more.asp?Page="&Page+1&"&News="&t&">下一页</a> <a href=news_more.asp?Page="&DataPage&"&News="&t&">尾页</a>"
TempText=TempText&" 共有 "&DataCount&" 条信息</td></tr>"
End If
TempText=TempText&"</table>"
Else
TempText="<div align=center>暂无"&t&"类企业</div>"
End IF
F_news_more=TempText
End Function
这个程序 现在读出来的就一列往下排 我想让他排3列 各位帮帮忙 展开
展开全部
兄弟,我发一段代码,你自己看看,理解意思以后自己随便怎么排都行。
<!-- -->
<%
if idid<>"" then
response.Write("<table width='98%' border='0' cellspacing='0' cellpadding='0' align='center'><tr>")
hangge=4 '一排显示条数
article=12 '本页显示条数
topiclen=15 '每条限制字数
Picture_width=180 '图片的宽度
Picture_height=122 '图片的高度
web_url="Details.asp?id="&idid '图片的连接
Page_url="ProductsSmall.asp?id="&idid '翻页的连接
set rs=server.CreateObject("adodb.recordset")
sql = "select id,parent,newsort,newspic,topic from viewnews where newsort="&idid&" and shenghe=1 and newspic<>'' order by istop desc,tjnews desc,px asc,id desc"
rs.open sql,conn,1,1
Totalarticle=rs.recordcount
if rs.recordcount>0 then
rs.pagesize=article
Totalpage=rs.pagecount
if request("page")<>"" then
page=int(request("page"))
else
page=1
end if
rs.absolutepage=page
for liebiao = 1 to rs.pagesize
%><td> </td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5"></td>
</tr>
<tr>
<td align="center"><a href="<%=web_url%>&Detailsid=<%=rs("id")%>" target="_blank" title="<%=rs("topic")%>"><img src="<%=rs("newspic")%>" width="<%=Picture_width%>" height="<%=Picture_height%>" style="border:1px solid #cdcdcd;"></a></td>
</tr>
<tr>
<td align="center" height="22"><a href="<%=web_url%>&Detailsid=<%=rs("id")%>" target="_blank" title="<%=rs("topic")%>"><%=left(rs("topic"),topiclen)%></a></td>
</tr>
</table></td>
<%
if liebiao mod hangge = 0 then
response.Write("</tr><tr>")
end if
rs.movenext
If rs.EOF Then Exit For
next
else
Totalarticle=0
end if
rs.close
set rs=nothing%>
</tr>
</table>
<%
if Totalarticle=0 then
response.Write(" 资料正在整理中... ...")
end if
%>
<!-- #include file=showpage.asp -->
<%end if%>
<!-- -->
<!-- -->
<%
if idid<>"" then
response.Write("<table width='98%' border='0' cellspacing='0' cellpadding='0' align='center'><tr>")
hangge=4 '一排显示条数
article=12 '本页显示条数
topiclen=15 '每条限制字数
Picture_width=180 '图片的宽度
Picture_height=122 '图片的高度
web_url="Details.asp?id="&idid '图片的连接
Page_url="ProductsSmall.asp?id="&idid '翻页的连接
set rs=server.CreateObject("adodb.recordset")
sql = "select id,parent,newsort,newspic,topic from viewnews where newsort="&idid&" and shenghe=1 and newspic<>'' order by istop desc,tjnews desc,px asc,id desc"
rs.open sql,conn,1,1
Totalarticle=rs.recordcount
if rs.recordcount>0 then
rs.pagesize=article
Totalpage=rs.pagecount
if request("page")<>"" then
page=int(request("page"))
else
page=1
end if
rs.absolutepage=page
for liebiao = 1 to rs.pagesize
%><td> </td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5"></td>
</tr>
<tr>
<td align="center"><a href="<%=web_url%>&Detailsid=<%=rs("id")%>" target="_blank" title="<%=rs("topic")%>"><img src="<%=rs("newspic")%>" width="<%=Picture_width%>" height="<%=Picture_height%>" style="border:1px solid #cdcdcd;"></a></td>
</tr>
<tr>
<td align="center" height="22"><a href="<%=web_url%>&Detailsid=<%=rs("id")%>" target="_blank" title="<%=rs("topic")%>"><%=left(rs("topic"),topiclen)%></a></td>
</tr>
</table></td>
<%
if liebiao mod hangge = 0 then
response.Write("</tr><tr>")
end if
rs.movenext
If rs.EOF Then Exit For
next
else
Totalarticle=0
end if
rs.close
set rs=nothing%>
</tr>
</table>
<%
if Totalarticle=0 then
response.Write(" 资料正在整理中... ...")
end if
%>
<!-- #include file=showpage.asp -->
<%end if%>
<!-- -->
展开全部
改成这样看看 (TypeData这个没看到具体的代码)
IF s<1 Then s=0
For ii=MaxperPage*(Page-1) To s
TempText=TempText&"<tr height=""35px"">"
Temp="<td width=""10%"" align=""center"" style=""border-bottom:1px dotted #E1E1E1;"">"&TypeData(7,ii)&"</td><td width=""40%"" style=""border-bottom:1px dotted #E1E1E1;"">·<a href=""news.asp?id="&TypeData(0,ii)&"""><b>"&TypeData(2,ii)&"</b></a></td><td width=""30%"" style=""border-bottom:1px dotted #E1E1E1;"">"&left(TypeData(6,ii),30)&"</td>"
IF TypeData(4,ii)="yes" Then Temp=""&Temp&""
TempText=TempText&Temp&"<td style=""border-bottom:1px dotted #E1E1E1;"">"&TypeData(3,ii)&"</td><td style=""border-bottom:1px dotted #E1E1E1;"">"&TypeData(5,ii)&"</td>"if i mod 3 = 0 then
&"</tr>"
end if
Next
IF s<1 Then s=0
For ii=MaxperPage*(Page-1) To s
TempText=TempText&"<tr height=""35px"">"
Temp="<td width=""10%"" align=""center"" style=""border-bottom:1px dotted #E1E1E1;"">"&TypeData(7,ii)&"</td><td width=""40%"" style=""border-bottom:1px dotted #E1E1E1;"">·<a href=""news.asp?id="&TypeData(0,ii)&"""><b>"&TypeData(2,ii)&"</b></a></td><td width=""30%"" style=""border-bottom:1px dotted #E1E1E1;"">"&left(TypeData(6,ii),30)&"</td>"
IF TypeData(4,ii)="yes" Then Temp=""&Temp&""
TempText=TempText&Temp&"<td style=""border-bottom:1px dotted #E1E1E1;"">"&TypeData(3,ii)&"</td><td style=""border-bottom:1px dotted #E1E1E1;"">"&TypeData(5,ii)&"</td>"if i mod 3 = 0 then
&"</tr>"
end if
Next
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
太乱了点吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不要用table排啦,采用DIV+CSS吧.
<ul class="subject_list">
<% for... %>
<li>subject</li>
<% next %>
</ul>
CSS里加上
li.subject_list {
float:left;
width:1/3宽度;
height:行高;
list-style-type:none;
margin:0px;
}
<ul class="subject_list">
<% for... %>
<li>subject</li>
<% next %>
</ul>
CSS里加上
li.subject_list {
float:left;
width:1/3宽度;
height:行高;
list-style-type:none;
margin:0px;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询