JSFiddle - React, Tailwind, and code Playground

HTML

<table>
    <tr>
        
        <td> test1 </td>
    </tr>
        <tr>
        
        <td> test2 </td>
    </tr>
        <tr>
        
        <td> test3 </td>
    </tr>
        <tr>
        
        <td> test 4</td>
    </tr>
</table>

CSS

table td{padding: 5px;
    background:#000;
        color:#fff;
}

JavaScript

$('table tr').click(function(){
    $(this).siblings().hide();
});
$('table tr').click(function(){
    $(this).siblings().show();
});