JSFiddle - React, Tailwind, and code Playground
by survivant
HTML
<body>
<table id='tb'>
</table>
</body>
JavaScript
$('#tb').ready(
function() {
console.log('table loaded');
var ar = Array(40);
for(var i=0;i<ar.length;i++){
ar[i]=Array(11);
}
ar[0][0] = 'Z';
var zx = 0.00;
for(var i=1;i<ar[0].length;i++){
ar[i][0] = zx.toFixed(2);
zx += 0.01;
}
var zy = 0.1;
for(var i=1;i<ar.length;i++){
ar[0][i] = zy.toFixed(2);
zy += 0.1;
}
ar[1][1] = 0.05.toFixed(4);
ar[1][2] = 0.504.toFixed(4);
ar[1][3] = 0.508.toFixed(4);
ar[1][4] = 0.512.toFixed(4);
ar[1][5] = 0.516.toFixed(4);
ar[1][6] = 0.5199.toFixed(4);
ar[1][7] = 0.5239.toFixed(4);
ar[1][8] = 0.5279.toFixed(4);
ar[1][9] = 0.5319.toFixed(4);
ar[1][10] = 0.5359.toFixed(4);
console.log('multidimensional array created!');
//Prepare the outputed string
var theTable = "";
for(var j=0;j<ar.length;j++){
theTable += '<tr>';
for(var k=0;k<ar[j].length;k++){
theTable += '<td>'+ar[k][j]+'</td>';
}
theTable += '</tr>';
}
//Finally appended the whole string to the table
$('#tb').append(theTable);
});