title: Merging cells of a table populated with MongoDB collection data?
body: <p>im currently using a <code>forEach</code> function to loop through my collection called <code>environments</code> to be displayed in an HTML table, but since there are multiple rows with the same version, how do i go about merging just those cells? I know i can use <code>rowspan</code> to merge cells, but my issues stems from using a <code>forEach</code>. using <code>rowspan</code> in a loop like that causes obvious issues, hence my question...</p>
  
  <pre><code>&lt;table class="table"&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th scope="col"&gt;Version&lt;/th&gt;
        &lt;th scope="col"&gt;Region&lt;/th&gt;
        &lt;th scope="col"&gt;Contact Name&lt;/th&gt;
        &lt;th scope="col"&gt;Date Added&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;% environments.forEach(function(environment){ %&gt;
      &lt;tr&gt;
        &lt;td&gt;
          &lt;%= environment.version %&gt;
        &lt;/td&gt;
          &lt;td&gt;
            &lt;%= environment.region %&gt;
          &lt;/td&gt;
          &lt;td&gt;
            &lt;%= environment.contact %&gt;
          &lt;/td&gt;
          &lt;td&gt;
            &lt;%= environment.date %&gt;
          &lt;/td&gt;
       &lt;% }); %&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I'm trying to take entries in a MongoDB collection like this:</p>
  
  <pre><code>{
  "version" : "1.0",
  "region" : "CA",
  "contact" : "Smith",
  "date" : "2019.09"
  }
  </code></pre>
  
  <p>many entries have <code>version 1.0</code> so when i loop through the collection to be displayed in a table, it shows up as something like:</p>
  
  <pre><code>Version   | Region| Contact Name | Date Added
  ----------------------------------------------
  version 1 | CA    | Smith        | 2019.09
  version 1 | CO    | Kovach       | 2019.08
  version 1 | WA    | Scott        | 2019.10
  version 1 | OR    | Lee          | 2020.01
  version 1 | HI    | Franco       | 2020.01
  </code></pre>
  
  <p>but does anyone know how to change it so that it doesn't list <code>version 1</code> over and over again? I can't figure out how to do it because there is also a few that are <code>version 2</code>, etc. i want it to look like:</p>
  
  <pre><code>Version   | Region| Contact Name | Date Added
  ----------------------------------------------
            | CA    | Smith        | 2019.09
            | CO    | Kovach       | 2019.08
  version 1 | WA    | Scott        | 2019.10
            | OR    | Lee          | 2020.01
            | HI    | Franco       | 2020.01
            | CA    | Chow         | 2019.09
            | AZ    | Reynolds     | 2019.08
  version 2 | MI    | Cooper       | 2019.06
            | CO    | Gooden       | 2020.01
            | HI    | Parr         | 2020.10
  </code></pre>