JSFiddle - React, Tailwind, and code Playground

JavaScript

function createTable(tableData) {
      var table = document.createElement('table');
      var row = {};
      var cell = {};
    
      tableData.forEach(function(rowData) {
        row = table.insertRow(-1);
        rowData.forEach(function(cellData) {
          cell = row.insertCell();
    			cell.textContent = cellData;
        });
      });
      document.body.appendChild(table);
    }
    
createTable([["row 1, cell 1", "row 2, cell 2"], ["row 2, cell 1", "row 2, cell 2"], ["row 3, cell 1", "row 3, cell 2"]]);