JSFiddle - React, Tailwind, and code Playground

HTML

<table>
  <tr>
    <td></td>
    <td>Row 1 cell 2</td>
    <td>Row 1 cell 3</td>
    <td>Row 1 cell 4</td>
  </tr>
  <tr>
    <td>Row 2 cell 1</td>
    <td>Row 2 cell 2</td>
    <td>Row 2 cell 3</td>
    <td>Row 2 cell 4</td>
  </tr>
</table>

JavaScript

var tRows = $('tr').map(function() {
  return [$(this).find('td').map(function(i) {
    if(i != 0 || $(this).text().length) return $(this).text()
  }).get()]
}).get()

console.log(JSON.stringify(tRows, 0, 4))