请ASP高手帮帮忙哟。。如何让数据调入时两列显示。。下面是我的代码。。
图片地址:http://www.gzlh.net/111.gif(就像这样就可以了)<divalign="center"><tableborder="0"width="4...
图片地址:http://www.gzlh.net/111.gif (就像这样就可以了)
<div align="center">
<table border="0" width="400" cellspacing="0" cellpadding="0" id="table13" height="48">
<tr>
<td height="24" width="400" align="left" valign="top">
<%
dim tupian
set rs = server.CreateObject("ADODB.RecordSet")
SQLStr = "select top 7 * from info where bt <> '' and lmmc = '国际新闻' order by id desc"
rs.open SQLStr, conn, 1, 1
do while not rs.eof
tupian=rs("D_SaveFileName")
%>
<table border="0" width="320" cellspacing="0" cellpadding="0" height="23" id="table13">
<tr><td width="320" height="23">
<table border="0" width="399" cellspacing="0" cellpadding="0" height="23">
<tr>
<td width="20" align="left" height="23"><img src="images/b.gif" border="0" width="11" height="11"></td>
<td align="left" width="304" valign="bottom" height="23"><a href="gjxw_show.asp?id=<%=rs("id")%>" target="_blank" title="<%=rs("bt")%>"><span class="font2"><%=btview(rs("bt"), 18)%></span>
</td>
</tr> </tr>
</table>
</td></tr>
<tr><td height="1" width="320" background="images/line.gif"></td></tr>
</table>
<%
rs.movenext
loop
rs.close
set rs = nothing
%>
</td>
</tr>
<tr>
<td align="center" width="400" height="24" valign="bottom">
<a href="gjxwindex.asp"><font class="font9">更多...</font></a></td>
</tr>
</table>
</div> 展开
<div align="center">
<table border="0" width="400" cellspacing="0" cellpadding="0" id="table13" height="48">
<tr>
<td height="24" width="400" align="left" valign="top">
<%
dim tupian
set rs = server.CreateObject("ADODB.RecordSet")
SQLStr = "select top 7 * from info where bt <> '' and lmmc = '国际新闻' order by id desc"
rs.open SQLStr, conn, 1, 1
do while not rs.eof
tupian=rs("D_SaveFileName")
%>
<table border="0" width="320" cellspacing="0" cellpadding="0" height="23" id="table13">
<tr><td width="320" height="23">
<table border="0" width="399" cellspacing="0" cellpadding="0" height="23">
<tr>
<td width="20" align="left" height="23"><img src="images/b.gif" border="0" width="11" height="11"></td>
<td align="left" width="304" valign="bottom" height="23"><a href="gjxw_show.asp?id=<%=rs("id")%>" target="_blank" title="<%=rs("bt")%>"><span class="font2"><%=btview(rs("bt"), 18)%></span>
</td>
</tr> </tr>
</table>
</td></tr>
<tr><td height="1" width="320" background="images/line.gif"></td></tr>
</table>
<%
rs.movenext
loop
rs.close
set rs = nothing
%>
</td>
</tr>
<tr>
<td align="center" width="400" height="24" valign="bottom">
<a href="gjxwindex.asp"><font class="font9">更多...</font></a></td>
</tr>
</table>
</div> 展开
展开全部
看你是用表格的,直接给你改好发过去了,如果还有问题再说啦
<div align="center">
<%dim tupian
set rs = server.CreateObject("ADODB.RecordSet")
SQLStr = "select top 20 * from info where bt <> '' and lmmc = '国际新闻' order by id desc"
rs.open SQLStr, conn, 1, 1
Response.Write("<table width=""50%"" border=""0"" align=""center"" cellpadding=""4"" cellspacing=""4"">")
Response.Write("<tr><td valign=""top"">")
i=1
Do While not rs.eof
%>
<img src="images/b.gif" border="0" width="11" height="11"></td>
<td align="left" width="304" valign="bottom" height="23"><a href="gjxw_show.asp?id=<%=rs("id")%>" target="_blank" title="<%=rs("bt")%>"><span class="font2"><%=btview(rs("bt"), 18)%></span>
<% if tupian <>"" then response.write("<font color='red'>(图)</font>") end if%></a></td>
<td align="left" width="100" valign="bottom" height="23"><span class="font4">[<%=rs("Createtime")%>]</span></td>
<%
if i mod 2 = 0 then
Response.Write("</td></tr><tr><td>")
else
Response.Write"</td><td>"
end if
rs.MoveNext
i = i + 1
Loop
Response.write"</td></tr>"
Response.Write("</table>")
%>
</div>
<div align="center">
<%dim tupian
set rs = server.CreateObject("ADODB.RecordSet")
SQLStr = "select top 20 * from info where bt <> '' and lmmc = '国际新闻' order by id desc"
rs.open SQLStr, conn, 1, 1
Response.Write("<table width=""50%"" border=""0"" align=""center"" cellpadding=""4"" cellspacing=""4"">")
Response.Write("<tr><td valign=""top"">")
i=1
Do While not rs.eof
%>
<img src="images/b.gif" border="0" width="11" height="11"></td>
<td align="left" width="304" valign="bottom" height="23"><a href="gjxw_show.asp?id=<%=rs("id")%>" target="_blank" title="<%=rs("bt")%>"><span class="font2"><%=btview(rs("bt"), 18)%></span>
<% if tupian <>"" then response.write("<font color='red'>(图)</font>") end if%></a></td>
<td align="left" width="100" valign="bottom" height="23"><span class="font4">[<%=rs("Createtime")%>]</span></td>
<%
if i mod 2 = 0 then
Response.Write("</td></tr><tr><td>")
else
Response.Write"</td><td>"
end if
rs.MoveNext
i = i + 1
Loop
Response.write"</td></tr>"
Response.Write("</table>")
%>
</div>
展开全部
直接用DIV+CSS轻松搞定。
首先要用到
如两列:----------------------------------------------------------------------------------------------
<div style="width:120px; ">
<ul>
<%
dim tupian
set rs = server.CreateObject("ADODB.RecordSet")
SQLStr = "select top 7 * from info where bt <> '' and lmmc = '国际新闻' order by id desc"
rs.open SQLStr, conn, 1, 1
do while not rs.eof
tupian=rs("D_SaveFileName")
%>
<li style="float:left;width:60px;list-style:none;"><%=rs("字段")%></li> ----- 这里宽度width:60px 是div宽度的2分之1
<%
rs.movenext
loop
rs.close
set rs = nothing
%>
</ul>
</div>
如三列:-----------------------------------------------------------------------------------------------
<div style="width:120px; ">
<ul>
<%
dim tupian
set rs = server.CreateObject("ADODB.RecordSet")
SQLStr = "select top 7 * from info where bt <> '' and lmmc = '国际新闻' order by id desc"
rs.open SQLStr, conn, 1, 1
do while not rs.eof
tupian=rs("D_SaveFileName")
%>
<li style="float:left;width:40px;list-style:none;"><%=rs("字段")%></li> ----- 这里宽度width:40px 是div宽度的3分之1
<%
rs.movenext
loop
rs.close
set rs = nothing
%>
</ul>
</div>
--------------利用DIV标签宽度来排列。
首先要用到
如两列:----------------------------------------------------------------------------------------------
<div style="width:120px; ">
<ul>
<%
dim tupian
set rs = server.CreateObject("ADODB.RecordSet")
SQLStr = "select top 7 * from info where bt <> '' and lmmc = '国际新闻' order by id desc"
rs.open SQLStr, conn, 1, 1
do while not rs.eof
tupian=rs("D_SaveFileName")
%>
<li style="float:left;width:60px;list-style:none;"><%=rs("字段")%></li> ----- 这里宽度width:60px 是div宽度的2分之1
<%
rs.movenext
loop
rs.close
set rs = nothing
%>
</ul>
</div>
如三列:-----------------------------------------------------------------------------------------------
<div style="width:120px; ">
<ul>
<%
dim tupian
set rs = server.CreateObject("ADODB.RecordSet")
SQLStr = "select top 7 * from info where bt <> '' and lmmc = '国际新闻' order by id desc"
rs.open SQLStr, conn, 1, 1
do while not rs.eof
tupian=rs("D_SaveFileName")
%>
<li style="float:left;width:40px;list-style:none;"><%=rs("字段")%></li> ----- 这里宽度width:40px 是div宽度的3分之1
<%
rs.movenext
loop
rs.close
set rs = nothing
%>
</ul>
</div>
--------------利用DIV标签宽度来排列。
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询