我用以下asp代码实现了交互式链接,请问我如何把它单独的每个链接放进一个单元格中
这样就管理就非常方便了!
1 set myobj=server.createobject("mswc.nextlink")
1<font face="CommercialScript BT"> </font>
1<ul>
FOR I=1 to myobj.getlistcount("list.txt")
1<li type="disc"><a =myobj.getnthurl("list.txt",i)="" ```="" href="rtsp://172.16.0.1/```">
=myobj.getnthdescription("list.txt",I)
next
1</li></ul>
---------------------------------------------------------------
1<table border="1">
set myobj=server.createobject("mswc.nextlink")
1 <font face="CommercialScript BT"> </font>
2
3<ul>
4
FOR I=1 to myobj.getlistcount("list.txt")
1<li type="disc">
2<tr> <td><a =myobj.getnthurl("list.txt",i)="" ```="" href="rtsp://172.16.0.1/```">
=myobj.getnthdescription("list.txt",I)
next
1</li></ul>
2</table>
---------------------------------------------------------------
不知是不是这个意思
1 FOR I=1 to myobj.getlistcount("list.txt")
1<tr>
2<td>
3<a =myobj.getnthurl("list.txt",i)="" ```="" href="rtsp://172.16.0.1/```">
=myobj.getnthdescription("list.txt",I)
1</td>
2</tr>
1 next
---------------------------------------------------------------
使用表格来限定就是了。
一般的格式如下:
1<table>
2<tr>
循环
1<td>```
2=连接的值
3```</td>
中止循环
1</tr>
2</table>
---------------------------------------------------------------
试试下面这样:
1<tr>
2<td>
tds=0
FOR I=1 to myobj.getlistcount("list.txt")
1<a =myobj.getnthurl("list.txt",i)="" ```="" href="rtsp://172.16.0.1/```">
=myobj.getnthdescription("list.txt",I)
tds=tds + 1
if tds=3 then
response.write "</td></tr>
<tr><td>"
end if
next
1</td>
2</tr>
表示每3列换一行。
------------------------------------------
解决了,结贴
贴出我的源代码
1<html>
2<title>测试</title>
3<body>
set myobj=server.createobject("mswc.nextlink")
1<table border="1">
j=0
FOR i=1 to myobj.getlistcount("list.txt")
url1=myobj.getnthurl("list.txt",i)
explain=myobj.getnthdescription("list.txt",i)
if j mod 3=0 then
Response.Write "<tr><td width="250"><div align="center">"
else
Response.Write "<td width="250"><div align="center">"
end if
1<a =url1="" ```="" href="rtsp://172.16.0.1/```">
response.write explain
j=j + 1
if j mod 3=0 then
Response.Write "</div></td></div></td></tr>"
else
Response.Write ""
end if
next
1<tr>
2</tr></table>
3</body>
4</html>