i have a table with number of rows that some of rows are hidden and only visisble when "show" button clicked. my question is how can i display block my row with effect slide down? Here is My snippet :
function toggleRow(e){
var subRow = e.parentNode.parentNode.nextElementSibling;
subRow.style.display = subRow.style.display === 'none' ? 'table-row' : 'none';
}
.subRow {
background-color: #CFCFCF; display:none;
}
<table style="width:50%" border="1">
<caption>Test Table</caption>
<thead>
<tr align="center" class="parentRow">
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
<th>Column 4</th>
<th>Column 5</th>
</tr>
</thead>
<tbody>
<tr class="parentRow">
<td><a href="JavaScript:Void(0);" onclick="toggleRow(this);">SHOW</a></td>
<td>test cell</td>
<td>test cell</td>
<td>test cell</td>
<td>test cell</td>
</tr>
<tr class="subRow">
<td colspan="5"><p>Lorem ipsum dolor sit amet...</p></td>
</tr>
<tr class="parentRow">
<td><a href="JavaScript:Void(0);" onclick="toggleRow(this);">SHOW</a></td>
<td>test cell</td>
<td>test cell</td>
<td>test cell</td>
<td>test cell</td>
</tr>
<tr class="subRow">
<td colspan="5"><p>Lorem ipsum dolor sit amet...</p></td>
</tr>
</tbody>
</table>