zoukankan      html  css  js  c++  java
  • ASP递归层级表格数据展示

    代码 如下:

    <!--#include file="include/config.asp"-->
    <!--#include file="common/sub_function.asp"-->
    <htm>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>2012年6月工程进度报审表</title>
    </head>
    <body>
    <table border="1"  cellpadding="0" cellspacing="0">
      <tr>
        <td width="260">项目费用名称</td>
        <td width="120">分项权重%</td>
        <td width="120">截止上月累计进度完成%</td>
        <td width="120">本月完成进度%(或里程碑点)</td>
        <td width="120">截止本月累计进度完成%</td>
        <td width="120">备注</td>
        </td>
      </tr>
      <%call wbs_tree(93,1)%>
    </table>
    <%
    Function wbs_tree(id,i)
    strSQL="SELECT * from PLN_projwbs where parent_wbs_id="&id&" order by seq_num"
    Set rsTest = Server.CreateObject("ADODB.Recordset") '打开纪录集对象
    rsTest.Open strSQL, cnn 
    if not rsTest.eof then
        do while not rsTest.eof 
            wbs_id = rsTest("wbs_id")' WBS主键ID
            wbs_name=rsTest("wbs_name")'WBS名称
            haschild = ccint(rsTest("haschild"))'是否有子节点
            style = " style=""padding-left:"&(i*30)-30&"px"""'左填充WBS名称
            response.Write("<tr><td"&style&">"&wbs_name&"</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr>")
            if haschild=1 then
                call wbs_tree(wbs_id,i+1)'i为层级数
            end if
        rsTest.movenext
        loop
        rsTest.close 
        set rsTest=nothing 
    end if
    End Function
    %>
    </body>
    </html></html>
    <!--#include file="include/dispose.asp"-->

    运行效果图如下:

  • 相关阅读:
    web前端之 CSS
    web前端之 HTML标签详细介绍
    web前端之 HTML介绍
    c++之 scanf 接收用户输入内容
    JQ 全选、全不选
    java 除法向上,向下取整
    Java使用占位符拼接字符串
    eclipse远程debug
    阿里 drds 分布式数据库分节点查询
    Mysql 修改字段长度、修改列名、新增列、修改自增主键起始值
  • 原文地址:https://www.cnblogs.com/webczw/p/2780155.html
Copyright © 2011-2022 走看看