title: How to read an HTML table like a battleship game?
body: <p>I have this HTML table</p>
  
  <p><a href="https://i.stack.imgur.com/9DKxS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9DKxS.png" alt="enter image description here"></a></p>
  
  <p>And I would like to read it line by line using JavaScript (unfortunately I don't have a <code>class</code> or other stuff I can refer to in the table, it's just a plain HTML table) in order to create a map like</p>
  
  <pre><code>AC000(red)(green) =&gt; cell match.
  </code></pre>
  
  <p>So like in the screenshot the first items in the map will be.</p>
  
  <pre><code>AC000AA =&gt; AV
  AC000AB =&gt; AV
  ...
  AC000CA =&gt; PC
  </code></pre>
  
  <p>I've tried, using jQuery in node.:</p>
  
  <pre class="lang-js prettyprint-override"><code>var data = [];
  var firstGroup;
  const number = '000';
  var secondGroup;
  $('table').each(function(index) {
    // 5th table...
    if (index == 4) {
      $(this).find('tr').each(function(index) {
        if (index == 1) {
          // firstGroup = $(this).find('td').first().find('b').text();
          firstGroup = $(this).find('td').first().text();
        }
        if (index &gt; 1) {
          $(this).find('td').each(function(index) {
            // this is the single cell of the table
            if (index == 0) {
              secondGroup = $(this).text();
            }
            if (index &gt; 0) {
              //data.push($(this).html());
            }
          });
        }
      });
    }
  });
  </code></pre>
  
  <p>And it kinda works, but I wonder if there's the fastest way to read it. I don't care about the library or the language, but I would prefer something I can store in an array/map.</p>