title: Reiterate through classes inside a class inside a div jquery
body: <p>Suppose I have the following structure:</p>
  
  <pre><code>&lt;div id="table"&gt;
    &lt;div class="row"&gt;  
       &lt;div class="cell"&gt;a&lt;/div&gt;
       &lt;div class="cell"&gt;b&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="row"&gt;
       &lt;div class="cell"&gt;d&lt;/div&gt;
       &lt;div class="cell"&gt;c&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How do I reiterate through them in a way that I create the same structure but with <code>&lt;table&gt;</code> instead of <code>&lt;div id="table"&gt;</code>, <code>&lt;tr&gt;</code> instead of <code>&lt;div class="row"&gt;</code> and <code>&lt;td&gt;</code> with the content of the div instead of <code>&lt;div class="cell"&gt;</code>;</p>
  
  <p>I tried doing something like </p>
  
  <pre><code> let topics_table = '&lt;table&gt;'
                  $('#table &gt; .row').each(function(){
                      topics_table += '&lt;tr&gt;'
                          $(this + ' .cell').each(function(that){
                              topics_table += '&lt;td&gt;' + that.text() + '&lt;/td&gt;'    
                          })
                      topics_table += '&lt;/tr&gt;';
                  })
   topics_table += '&lt;/table&gt;`
  </code></pre>
  
  <p>But I get an error...</p>