JSFiddle - React, Tailwind, and code Playground
by Jose Montero
HTML
<div id="div1">
<table id="table1">
<tr><td>ID</td><td>content</td><td>Date</td> </tr>
</table>
</div>
CSS
table{
border: solid 1px black;
width: 100%;
}
JavaScript
var arr = [];
arr[0] = [1, 1, 0, 0, 0];
arr[1] = ['Peter', 'Mary', 'David', 'John', 'Billy'];
arr[2] = [3, 2, 5, 4, 1];
var arr2 = arr.reduce(function(prev, curr) {
return prev.concat(curr);
});
console.log(arr2)
arr2.sort(function (a,b) {
if (a[2] > b[2]) return 1;
if (a[2] < b[2]) return -1;
return 0;
});
console.log(arr2)