collapse div with jquery

<html>
<head>



<style>

.CSSTableGenerator {
    border: 0px solid #000000;
    border-radius: 0px;
    box-shadow: 10px 10px 5px #888888;
    margin: 74px;
    padding: 0px;
    width: 68%;
    margin: 35;
    -webkit-border-radius: 22px;
    -moz-border-radius: 22px;
    border-radius: 22px;

}
.CSSTableGenerator table {
    border-collapse: collapse;
    border-spacing: 0;
    height: 100%;
    margin: 0px;
    padding: 0;
    width: 100%;
}


.CSSTableGenerator td {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    background-color: #CCCCCC;
    border-color: #000000;
    border-image: none;
    border-style: solid;
    border-width: 0 1px 1px 0;
    color: #000000;
    font-family: Arial;
    font-size: 10px;
    font-weight: normal;
    padding: 7px;
    text-align: left;
    vertical-align: middle;
}


.CSSTableGenerator span {
    -webkit-border-radius: 22px 22px 0px 0px;-moz-border-radius: 22px 22px 0px 0px;border-radius: 22px 22px 0px 0px;
    background: -moz-linear-gradient(center top , #003366 5%, #003F7F 100%) repeat scroll 0 0 #003366;
    border-color: #000000;
    border-image: none;
    border-style: solid;
    border-width: 0 0 1px 1px;
    color: #FFFFFF;
    font-family: Arial;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    display:block;
    padding: 15px;
}


</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script  >

function showHide(id) {
   $( '#tabledata-'+id ).toggle("slow");
}


</script>
</head>
<body>
    <div class="CSSTableGenerator" >
       <span onclick="return showHide('1')" > I am here to ooooooo </span>
                <table   style="display:none;"   id="tabledata-1"  >
                    <tr >
                        <td> Title 1 i am here </td>
                    </tr >
                    <tr>
                        <td >  Row 1 </td>
                    </tr>
                    <tr>
                        <td >  Row 2 </td>
                    </tr>
                    <tr>
                        <td >  Row 2 </td>
                    </tr>
                    <tr>
                        <td >  Row 3 </td>
                    </tr>
                </table>
            </div>
    <div class="CSSTableGenerator" >
       <span onclick="return showHide('2')" > I am here to ooooooo </span>
                <table  style="display:none;" id="tabledata-2"  >
                    <tr>
                        <td> Title 1 </td>
                    </tr>
                    <tr>
                        <td >  Row 1 </td>
                    </tr>
                    <tr>
                        <td >  Row 2 </td>
                    </tr>
                    <tr>
                        <td >  Row 2 </td>
                    </tr>
                    <tr>
                        <td >  Row 3 </td>
                    </tr>
                </table>
            </div>
    <div class="CSSTableGenerator" >
       <span onclick="return showHide('3')"> I am here to ooooooo </span>
                <table  style="display:none;" id="tabledata-3"  >
                    <tr>
                        <td> Title 1 </td>
                    </tr>
                    <tr>
                        <td >  Row 1 </td>
                    </tr>
                    <tr>
                        <td >  Row 2 </td>
                    </tr>
                    <tr>
                        <td >  Row 2 </td>
                    </tr>
                    <tr>
                        <td >  Row 3 </td>
                    </tr>
                </table>
            </div>
</body>
</html>

No comments:

Other Articles

Enter your email address: