Is there a possibility to shuffle table rows and make them appear at random each time we click a button/icon (except for the first one with a header)? Something like w3schools' "How To Sort a Table" (https://www.w3schools.com/howto/howto_js_sort_table.asp) but so that the table would be sorted randomly.
The other possibility is to use JavaScript Array Sort but I wouldn't know how to make table rows appear as contents of an array.
https://jsfiddle.net/17bjxgfa/1/
I'd prefer vanilla JS solutions rather than jQuery.
Here is an exemplary table that we could work on:
.table-div {
padding-top: 1rem;
}
<div class="table-div">
<table id="myTable">
<tr>
<th class="button"><button class="my-btn" type="button" onclick="sortTable()">
shuffle</button></th>
<th>Text:</th>
<th></th>
</tr>
<tr>
<td class="left">Some text 1</td>
<td><input type="text"></td>
<td class="right">more text.</td>
<td class="button"><button class="my-btn" type="button">
check</button></td>
</tr>
<tr>
<td class="left">Some text 2</td>
<td><input type="text"></td>
<td class="right">more text.</td>
<td class="button"><button class="my-btn" type="button">
check</button></td>
</tr>
<tr>
<td class="left">Some text 3</td>
<td><input type="text"></td>
<td class="right">more text.</td>
<td class="button"><button class="my-btn" type="button">
check</button></td>
</tr>
<tr>
<td class="left">Some text 4</td>
<td><input type="text"></td>
<td class="right">more text.</td>
<td class="button"><button class="my-btn" type="button">
check</button></td>
</tr>
<tr>
<td class="left">Some text 5</td>
<td><input type="text"></td>
<td class="right">more text.</td>
<td class="button"><button class="my-btn" type="button">
check</button></td>
</tr>
<tr>
<td class="left">Some text 6</td>
<td><input type="text"></td>
<td class="right">more text.</td>
<td class="button"><button class="my-btn" type="button">
check</button></td>
</tr>
<tr>
<td class="left">Some text 7</td>
<td><input type="text"></td>
<td class="right">more text.</td>
<td class="button"><button class="my-btn" type="button">
check</button></td>
</tr>