title: Include if statement in HTML table
body: <p>I want to include an <code>if</code> statement in my PHP code that renders an HTML table. The output should be in a table row, too.</p>
  
  <pre><code>echo '&lt;table style="border:1px solid red;"&gt;',
   '&lt;tr align="center" &gt;&lt;td&gt;&lt;div class="item-font1"&gt;', $mounts['name'], '&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;',
   if ($itembind == 1) {
  echo '&lt;tr align="center" &gt;&lt;td&gt;&lt;div class="item-font1"&gt;Text1&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;',
  } elseif ($itembind== 2) {
  echo '&lt;tr align="center" &gt;&lt;td&gt;&lt;div class="item-font1"&gt;Text2&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;',
  echo "\t";
  }
   '&lt;tr align="center" &gt;&lt;td&gt;&lt;div class="item-font1"&gt;', $mounts['name'], '&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;  
  &lt;/table&gt;';
  ?&gt;
  </code></pre>
  
  <p>I tried it like this, but there are some errors. </p>