Expand only one row in javascript code
<p>hey guys having trouble figuring out how to make it so that i can make it only open one table at once, once you open another the other should close any help here? </p>

<pre><code>function showRow(cctab){
if (document.getElementById(cctab)) {
    document.getElementById(cctab).style.display = ''; 
}
}

function hideRow(row1){
if (document.getElementById(cctab)) {
    document.getElementById(cctab).style.display = 'none';
}
}

function toggleRow(cctab){
if (document.getElementById(cctab)) {
    if (document.getElementById(cctab).style.display == 'none') {
        showRow(cctab)
    } else {
        hideRow(cctab)
    }
}
}
</code></pre>

<p>Now I want to make it so that only one table "cctab" opens after I suggest the onClick="javascript:toggleRow(cctab);" anyhelp?</p>
