title: Why is bootstrap 4 adding an extra <td> tag here?
body: <p>I am using bootstrap with php to complete a coding exercise. The problem asks to create a table with city populations. For some reason the bottom of my table outputs an additional <code>&lt;td&gt;</code> tag that I cannot explain. I know its there via inspecting the source. </p>
  
  <pre><code>    &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"&gt;
  
  &lt;?php  
  
  $cities = array( 
      'ny' =&gt; 8175133,
      'la' =&gt; 3792621, 
      'chi' =&gt; 2695598, 
      'hou' =&gt; 2100263, 
      'phi' =&gt; 1526006, 
      'pho' =&gt; 1445632, 
      'sa' =&gt; 1327407, 
      'sd' =&gt; 1307402, 
      'dal' =&gt; 1197816, 
      'sj' =&gt; 945942 
              );
  $tot_pop = array_sum($cities);
  print "&lt;div class='container'&gt;&lt;table class='table'&gt;
  &lt;thead&gt;
  &lt;tr&gt;
  &lt;th scope='col'&gt;Cities&lt;/th&gt;
  &lt;th scope='col'&gt;Population&lt;/th&gt;
  &lt;/tr&gt;
  &lt;/thead&gt;";
  
  foreach($cities as $stadt =&gt; $pop) {
  print "&lt;tbody&gt;
  &lt;tr&gt;
  &lt;td&gt;$stadt&lt;/td&gt;
  &lt;td&gt;$pop&lt;/td&gt;     
  &lt;/tr&gt;";
  
  }
  
  print "
  &lt;tr&gt;
  &lt;td&gt;Total Pop&lt;td&gt;
  &lt;td&gt;";
  echo $tot_pop;
  "&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tbody&gt;
  &lt;/table&gt;
  &lt;/div&gt;";
  ?&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/LE9KK.jpg" rel="nofollow noreferrer">enter image description here</a></p>