以下是asp 代码,可以实现。
不知道asp.net代码如何写啊!<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="778" height="35" background="images/daohang.gif">
<tr>
                    <td><div align="right">
<table border="0" cellpadding="0" cellspacing="0" height="35">
<tr>
<td>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="13" height="35">
<tr>
<td>
<img border="0" src="images/Gaobei_skin/dhhead.gif" width="13" height="35"></td>
</tr>
</table>
</div>
</td>
<%
    Dim TopSortSql,RsTopSort,daohang,hide
    TopSortSql="select * from Sort where (B_id=0 or daohang<>'') and hide<>true order by s_order"
    Set RsTopSort=conn.execute (TopSortSql)
    With RsTopSort
    if .eof and .bof then
    Response.write "<td align='center' background='images/Gaobei_skin/dhmain.gif'>没有栏目</td>"
    else
   
     do while not .eof
    '==================
    if RsTopSort(trim("daohang"))<>"" then
    daohang=RsTopsort("daohang")
    else
    daohang=" Sort.asp?SortID="&RsTopSort("ID")&" "
    end if
    '==================
    response.write "<td>"
    response.write "<div align=right>"
    response.write "<table border=0 cellpadding=0 cellspacing=0 height=35 background='images/Gaobei_skin/dhmain.gif'>"
    response.write "<tr>"
    response.write "<td style='FILTER: DropShadow(Color=#ffffff, OffX=1, OffY=1, Positive=1); PADDING-TOP: 6px'>"
    response.write "<p align=center>"
    if RsTopSort("blank")=true then
    response.write "&nbsp;&nbsp;"
    Response.Write("<A href='"&daohang&"' target='_blank'><FONT color=#1E1919><span style='letter-spacing: 2px'>"  & RsTopSort("Names") & "</span></Font></a>")
    response.write "&nbsp;&nbsp;"
    else
    response.write "&nbsp;&nbsp;"
    Response.Write("<A href='"&daohang&"'><FONT color=#1E1919><span style='letter-spacing: 2px'>"  & RsTopSort("Names") & "</span></Font></a>")
    response.write "&nbsp;&nbsp;"
    end if
    response.write "</td>"
    response.write "<td width=11 background='images/Gaobei_skin/dhzhong.gif'></td>"
    response.write "</tr>"
    response.write "</table>"
    response.write "</div>"
    response.write "</td>"
    .movenext  
   loop
    
    end if 
    .close 
    End With
    Set RsTopSort=Nothing
%> </tr>
</table>
</div></td>
</tr>
</table>
</div>