title: Angular 5 How to insert a string as a HTML element
body: <p>I am getting response from server as string :</p>
  
  <pre><code>&lt;table&gt;&lt;thead&gt;&lt;tr&gt; &lt;th scope="col"&gt;Home&lt;/th&gt; &lt;th scope="col"&gt;Page &lt;/th&gt; &lt;th scope="col"&gt;World &lt;/th&gt; &lt;th scope="col"&gt;HE &lt;/th&gt; &lt;th scope="col"&gt;MAN&lt;/th&gt; &lt;th scope="col"&gt;GO&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;145&lt;/td&gt;&lt;td&gt;42&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;3125&lt;/td&gt;&lt;td&gt;315&lt;/td&gt;&lt;td&gt;2554&lt;/td&gt;&lt;td&gt;5542&lt;/td&gt;&lt;td&gt;331255&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
  </code></pre>
  
  <p>How can i insert this in my page directly as a html element so that i can view a html table to users.</p>
  
  <p>I am new to angular below is thing which i have tried :</p>
  
  <p>i have created a variable in my componenet class as htmltable and tried to create a htmlelemnt like below </p>
  
  <pre><code>this.htmltable = document.createElement(serverresponse.htmltable)
  </code></pre>
  
  <p>but its not working .</p>
  
  <p>also i have tried this way :</p>
  
  <pre><code> &lt;div class="dynamically_created_div unique_identifier" #d1&gt;&lt;/div&gt;
      @ViewChild('d1') d1:ElementRef;
          this.renderer.appendChild(this.d1, serverresponse.htmltable);
  </code></pre>
  
  <p>but its not working. Please suggest me the correct way of doing this</p>