title: Iterating through HTML table returns Uncaught TypeError: '0' property for undefined
body: <p>I've written a function that loops through every cell in an HTML table and upon matching a text pattern 'red.png' applies a jQuery method against another element on the page.</p>
  
  <p>However, when executing said function I receive an </p>
  
  <blockquote>
    <p>"Uncaught TypeError: Cannot read property '0' of undefined"</p>
  </blockquote>
  
  <p>I originally thought this may be due to the table not being declared in the DOM on page execution, but have tested this by outputting the "table" variable below in console.log - I can see the table fine.</p>
  
  <p>My code is below:</p>
  
  <pre><code>function poll() {
      var table = document.getElementById("myTable");
      //console.log(table);
      for (var i = 0, cell; table.cells[i]; i++) {
          if (cell[i].indexOf('red.png') != -1) {
              $("#tenantPreviewLive").css('background-color', '#FF0000');
              $("#maximiseLive").css('background-color', '#FF0000');
          }
      }
  }
  </code></pre>
  
  <p>Any responses are appreciated!</p>