JSFiddle - React, Tailwind, and code Playground
HTML
<table>
<tr>
<td>Product</td>
<td>Price</td>
<td>Destination</td>
<td>Updated on</td>
</tr>
<tr>
<td>Oranges</td>
<td>100</td>
<td><a href="#" class="toggler" data-prod-fruit="1">+ On Store</a></td>
<td>22/10</td>
</tr>
<tr class="fruit1" style="display:none">
<td></td>
<td>120</td>
<td>City 1</td>
<td>22/10</td>
</tr>
<tr class="fruit1" style="display:none">
<td></td>
<td>140</td>
<td>City 2</td>
<td>22/10</td>
</tr>
<tr>
<td>Apples</td>
<td>100</td>
<td><a href="#" class="toggler" data-prod-fruit="2">+ On Store</a></td>
<td>22/10</td>
</tr>
<tr class="fruit2" style="display:none">
<td></td>
<td>120</td>
<td>City 1</td>
<td>22/10</td>
</tr>
<tr class="fruit2" style="display:none">
<td></td>
<td>140</td>
<td>City 2</td>
<td>22/10</td>
</tr>
</table>
CSS
table{
border-collapse: collapse;
border-style: hidden;
margin:0 auto 0 auto;
position:relative;
width:100%;
font-size:12px;
background-color:#edf1f7;
}
table td, table th {
border: 1px solid black;
height:30px;
}
JavaScript
$(document).ready(function(){
$(".toggler").click(function(e){
e.preventDefault();
$('.fruit'+$(this).attr('data-prod-fruit')).toggle();
});
});