表格折叠

js:########################hidden "tab_view"表格

function display(obj)
{
 var regx=/open.gif/;
 var str=obj.src;

if(regx.test(str))
{

obj.src="image/close.gif";
obj.parentNode.parentNode.parentNode.parentNode.rows(1).style.display="none";

}

 else {

obj.src="image/open.gif"; obj.parentNode.parentNode.parentNode.parentNode.rows(1).style.display="block"; }
}



///
html######################################
<table class="dragTable" id="tab1" style="BORDER-RIGHT: red 0px dashed; BORDER-TOP: #3366cc 1px solid; DISPLAY:block; Z-INDEX: 1; BORDER-LEFT: red 0px dashed; BORDER-BOTTOM: red 0px dashed"cellSpacing="0" border="0">



    <tr class="dragTR">

        <td><img id="img1" onclick="display(this)" src="image/open.gif" align="left">

            <asp:label id="class_name" Runat="server">自定义网址收藏夹</asp:label>

            <img onclick="dele_class(this)" src="image/dele.gif" align="right">

             <IMG style="WIDTH: 16px; HEIGHT: 8px" onclick="return dropdownmenu(this, event, menu2, '200px')"

                   onmouseout="delayhidemenu()" height="8" src="image/edit.gif" width="16" align="right">
        </td>

    </tr>





    <tr>
        <td>
            <table id="tab_view" borderColor="gainsboro" cellSpacing="0"     cellPadding="0" align="center"
                                        bgColor="white" border="0">
                <tr>
                    <td width="200px" height="15px">
                    </td>
                </tr>
            </table>
        </td>
    </tr>


                           
</table>
原文地址:https://www.cnblogs.com/smallfa/p/1171138.html