title: Check if each cell in a table is equal to the cell above
body: <p>How do you check in JS what the value of the td above the current one is in a table? I'm trying to get a table like this:</p>
  
  <pre><code>|column1 | column2 | column3 | column4 | 
  ----------------------------------------
  |        |         |         |         |
  ----------------------------------------
  |        |         |  data   |         |
  ----------------------------------------
  |        |         |  data   |   fox   |
  ----------------------------------------
  |        |  bacon  |         |         |
  ----------------------------------------
  |        |         |         |         |
  </code></pre>
  
  <p>To look like this:</p>
  
  <pre><code>|column1 | column2 | column3 | column4 | 
  ----------------------------------------
  |        |         |         |         |
  ----------------------------------------
  |        |         |         |         |
  --------------------  data   -----------
  |        |         |         |   fox   |
  ----------------------------------------
  |        |  bacon  |         |         |
  ----------------------------------------
  |        |         |         |         |
  </code></pre>
  
  <p>My plan was to loop through each td element, to check the html of that td, then the one above, and if they are equal, hide the bottom one, and set the rowspan of the top one to 2. </p>
  
  <p>I'm having trouble iterating through the td elements, I've tried some jQuery like this:</p>
  
  <pre><code> $("#myTable td").each(function(){
       console.log($(this).html())
   });
  </code></pre>
  
  <p>But I can't access easily the cell above/below the current one. Any ideas?</p>