JSFiddle - React, Tailwind, and code Playground

HTML

<input type="file" id="file" name="file" />
<table id="rows"></table>

JavaScript

var output = $('#rows');
$('#file').on('change', function(evt) {
    var files = evt.target.files;
    for (var i = 0, f; f = files[i]; i++) {
        // Only process text files.
        if (!f.type.match('text/.*')) {
           alert('Unsupported filetype:'+f.type);
           continue;
        }
        var reader = new FileReader();
        reader.onloadend = function(evt) {
            var rows, row, cols, col, html;
          if (evt.target.readyState == FileReader.DONE) {
              output.empty();
              rows = evt.target.result.match(/[^\r\n]+/g);
              for(row = 0; row < rows.length; row++) {
                  cols = rows[row].split(',');
                  html = '<tr>';
                  for(col = 0; col < cols.length; col++) {
                      html += '<td>'+cols[col]+'</td>';
                  }
                  html += '</tr>';
                  output.append(html);
              }
          }
        };

        // Read in the text file
        reader.readAsBinaryString(f);
    }
});