Results 1 to 5 of 5

Thread: hide a table ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2000
    Posts
    156

    Question

    is it possible to hide a table's row ? or a table's header ? or the whole table ?

    The MORE I get to know,
    I realize that I know NOTHING !

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    assuming you are talking about tables in active server pages...

    why do you want to hide it?

    if the table is being written by code, just stop it from being written.

    if the table is not being written by code change it so it is and then don't do it!

    Mark
    -------------------

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2000
    Posts
    156
    well u c Mark,

    i wrote an asp code that alow me to draw a treeview based on a database(treeview table with the fields: NKey,Parent,Caption,link,stage,isLast)

    as far as i go is to draw the treeview.
    the problem is that when i clicking the img('plus') the rest of the nodes doesn't appear.

    i m sending the code, if any one knows how to change it to work it will be great.

    the code:




    <%@ Language=VBScript %>
    <%
    dim OBus
    set OBus = server.CreateObject("TreeBusiness.clsTreeBusiness")
    call OBus.InitializeLogin("10.10.10.8","Project_liron","sa","sasa")

    %>
    <HEAD>
    <STYLE>
    TABLE {font-size:10 ; font-face:TimeNew ; column-height:20 ; row-height:20; }
    IMG {width:14 ; height:18 }
    BODY{{Background-color:"#ffffd0"}
    </STYLE>
    <BASE TARGET="main">
    <SCRIPT language="JavaScript">
    <!-- //Creates folding tree effect
    var head="display:''"
    function doit(header)
    {
    var head=header.style
    if (head.display=="none")
    head.display=""
    else
    head.display="none"
    }
    //-->
    </SCRIPT>
    </HEAD>
    <HTML>
    <body>
    <%
    call BuildTree("RP",0)

    sub BuildTree(parent , level)
    dim rs
    set rs = server.CreateObject("ADODB.Recordset")

    set rs =OBus.GetNodes("Parent='" & cstr(parent) & "'")
    if (not(rs.EOF) and not(rs.BOF)) then
    while (not(rs.EOF))
    if (level=0) then
    call InitTree(rs.fields("Caption"),rs.Fields("NKey"),rs.Fields("Link"))
    call BuildTree(rs.Fields("NKey"),level+1)
    call LastPage("My Helper","c","help.htm",0)
    else
    if ((level=1) or (level=2)) then
    call SubBook(rs.fields("Caption"),rs.Fields("NKey"),rs.Fields("Link"),rs.Fields("Stage"))
    call BuildTree(rs.Fields("NKey"),level+1)
    else
    if (level=3 and rs.fields("IsLast")=0) then
    call SubPage(rs.fields("Caption"),rs.Fields("NKey"),rs.Fields("Link"),rs.Fields("Stage"))
    else
    call LastPage(rs.fields("Caption"),rs.Fields("NKey"),rs.Fields("Link"),rs.Fields("Stage"))
    end if
    end if
    end if
    rs.MoveNext
    wend
    set rs = nothing
    end if
    end sub

    sub ExpandCollapse()
    dim oElement
    dim imgIcon

    set oElement= window.event.srcElement

    end sub

    sub InitTree(sCaption,sKey,sLink)
    Response.Write("<TABLE cellpadding=0 cellspacing=0>")
    Response.Write("<TR>")
    Response.Write("<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_open.gif'></TD>")
    Response.Write("<TD><A HREF='" & sLink & "'>" & sCaption & "</A>")
    Response.Write("</TD>")
    Response.Write("</TR>")
    Response.Write("</TABLE>")
    end sub

    sub SubBook(sCaption,sKey,sLink,ilevel)
    if ilevel=1 then
    Response.Write("<TABLE NAME='tbl" & trim(cstr(sKey)) & "' cellpadding=0 cellspacing=0>")
    else
    Response.Write("<TABLE NAME='tbl" & trim(cstr(sKey)) & "' style='display:none' cellpadding=0 cellspacing=0>")
    end if
    Response.Write("<TR>")
    for i=1 to ilevel
    Response.Write("<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_line.gif'></TD>")
    next
    if true then
    Response.Write("<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_listp.gif' onclick='doit(tblaaa)'></TD>")
    else
    Response.Write("<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_list.gif'></TD>")
    end if
    Response.Write("<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_book.gif'></TD>")
    Response.Write("<TD><A HREF='" & sLink & "'>" & sCaption & "</A>")
    Response.Write("</TD>")
    Response.Write("</TR>")
    Response.Write("</TABLE>")
    end sub

    sub SubPage(sCaption,sKey,sLink,ilevel)
    Response.Write("<TABLE NAME='tbl" & trim(cstr(sKey)) & "' style='display:none' cellpadding=0 cellspacing=0>")
    Response.Write("<TR>")
    for i=1 to ilevel
    Response.Write("<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_line.gif'></TD>")
    next
    Response.Write("<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_list.gif'></TD>")
    Response.Write("<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_leaf.gif'></TD>")
    Response.Write("<TD><A HREF='" & sLink & "'>" & sCaption & "</A>")
    Response.Write("</TD>")
    Response.Write("</TR>")
    Response.Write("</TABLE>")
    end sub

    sub LastPage(sCaption,sKey,sLink,ilevel)
    dim i
    if ilevel=0 then
    Response.Write("<TABLE NAME='tbl" & trim(cstr(sKey)) & "' cellpadding=0 cellspacing=0>")
    else
    Response.Write("<TABLE NAME='tbl" & trim(cstr(sKey)) & "' style='display:none' cellpadding=0 cellspacing=0>")
    end if

    Response.Write("<TR>")
    for i=1 to ilevel
    Response.Write("<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_line.gif'></TD>")
    next
    Response.Write("<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_end.gif' ></TD>")
    Response.Write("<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_leaf.gif'></TD>")
    Response.Write("<TD><A HREF='" & sLink & "'>" & sCaption & "</A>")
    Response.Write("</TD>")
    Response.Write("</TR>")
    Response.Write("</TABLE>")
    end sub


    %>

    </BODY>
    </HTML>
    The MORE I get to know,
    I realize that I know NOTHING !

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    I had previously stole (errr....borrowed...) this code from the M$ site. I just got rid of all the crap. This only works in IE, I believe

    The class names refer to the style sheet, but that doesn't matter so just ignore the CLASS tags....

    Code:
    <HTML>
    <SCRIPT LANGUAGE=JAVASCRIPT>
    
    function ToggleDisplay(oButton, oItems)
    {
    
    	if ((oItems.style.display == "") || (oItems.style.display == "none"))	
    	{
    		oItems.style.display = "block";
    		oButton.src = "minus.gif";
    	}	
    	else 
    	{
    		oItems.style.display = "none";
    		oButton.src = "plus.gif";
    	}
    	
    	return false;
    }
    
    </SCRIPT>
    <!--Begin Left NavBar-->
    <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="2" WIDTH="100" BGCOLOR="#FFFFFF" ID="leftNavTable" STYLE="margin-top: 5px;">
    
    <TR>
    <TD ALIGN="center" VALIGN="top"><LABEL FOR="m1"><IMG SRC='plus.gif' HEIGHT='9' WIDTH='9' ALIGN='right' ID="m1" CLASS="clsImgButton" ONCLICK="ToggleDisplay(m1, mSubItems1);" ALT BORDER="0"></LABEL></TD>
    	<TD WIDTH="100%">
    		<A HREF="javascript:void();" ID="mSub" CLASS="clsTocHead" ONCLICK="return ToggleDisplay(m1, mSubItems1);">Menu 1</A>
    		<DIV ID="mSubItems1" CLASS="clsTocItem"><SCRIPT>mSubItems1.style.display='none';</SCRIPT>
    			<DIV CLASS="clsTocItem1"><A target=data HREF="doc.html" >Doc1</A></DIV>
    			<DIV><A target=data HREF="coverletter.doc">Doc2</A></DIV>
    			<DIV><A target=data HREF="doc3.html">Doc3</A></DIV>
    		</DIV>
    	</TD>
    </TR>
    
    <TR>
    <TD ALIGN="center" VALIGN="top"><LABEL FOR="m2"><IMG SRC='plus.gif' HEIGHT='9' WIDTH='9' ALIGN='right' ID="m2" CLASS="clsImgButton" ONCLICK="ToggleDisplay(m2, mSubItems2);" ALT BORDER="0"></LABEL></TD>
    	<TD WIDTH="100%">
    		<A HREF="javascript:void();" ID="mSub" CLASS="clsTocHead" ONCLICK="return ToggleDisplay(m2, mSubItems2);">Menu 2</A>
    		<DIV ID="mSubItems2" CLASS="clsTocItem"><SCRIPT>mSubItems2.style.display='none';</SCRIPT>
    			<DIV CLASS="clsTocItem1"><A target=data HREF="doc.html" >Doc1</A></DIV>
    			<DIV><A target=data HREF="doc2.html">Doc2</A></DIV>
    			<DIV><A target=data HREF="doc3.html">Doc3</A></DIV>
    		</DIV>
    	</TD>
    </TR>
    
    </TABLE>
    </HTML>

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2000
    Posts
    156
    thanks but i already overcome this problem c my next debate
    about the new related problem here

    http://forums.vb-world.net/showthread.php?postid=85763

    lirlir
    The MORE I get to know,
    I realize that I know NOTHING !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width