I am making a table and it will have a visible tr and below a hidden one and so on. In the last one, I put an 'expandTable' class and hide a 'HiddenTable' class. At the time of the click instead of opening the correspondent ends up opening all the hidden at once, in jquery I did so
var tabelaOculta = $(".tabelaOculta").hide();
var oculta = false;
$(".expandirTabela").click(function(){
if(oculta == false){
$(this).parent().find(".tabelaOculta").show();
oculta = true;
}else{
$(this).parent().find(".tabelaOculta").hide();
oculta = false;
}
});
and my table
<tr class="expandirTabela">
<td>+</td>
<td>R$ 60.000,00</td>
<td>R$ 15.000,00</td>
</tr>
<tr class="tabelaOculta">
<td colspan="3">
<table>
<tr>
<td>conteúdo oculto aqui</td>
</tr>
</table>
</td>
</tr>