JSFiddle - React, Tailwind, and code Playground

HTML

<table id="mytab1" width="80%" border="2" cellspacing="0" cellpadding="0">
    <tr>
        <td></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
</table>

JavaScript

var b = [];
for (var i = 0; i < 3; i++) {
    b[i] = [];
    for (var j = 0; j < 3; j++) {
        b[i][j] = window.prompt("b[" + (i + 1) + "," + (j + 1) + "] = ?");
    }
}

var table = document.getElementById("mytab1");
for (var i = 0, row; row = table.rows[i]; i++) {
    //iterate through rows
    //rows would be accessed using the "row" variable assigned in the for loop
    for (var j = 0, col; col = row.cells[j]; j++) {
        //iterate through columns
        //columns would be accessed using the "col" variable assigned in the for loop
        col.innerText = b[i][j];

    }
}