title: HTML Tags not rendered properly when passing to view PHP-JS
body: <p>Hi i am using codeigniter framework , </p>
  
  <p>i am using an ajax request to get data from db and to show in view.</p>
  
  <pre><code>    var from_date = jQuery('#form_date').val();
      var to_date = jQuery('#to_date').val();
  
      jQuery.ajax({
          url:base_url+"index.php/eod_report/search_to_date",
          type:"POST",
          data:{from_date:from_date,to_date:to_date},
          //datatype:'json',
          success:function(data){
  
              jQuery("#report_container").html(data); 
          }
  </code></pre>
  
  <p>my controler is </p>
  
  <pre><code>public function search_to_date()
  {
      $from_date = $this-&gt;input-&gt;post('from_date');
      $to_date = $this-&gt;input-&gt;post('to_date');
  
      $where_array = array('eod.created_time &gt;='=&gt;$from_date,'eod.created_time &lt;='=&gt;$to_date);
  
      $eod_report_data = $this-&gt;eod_data-&gt;get_eod_report_data($where_array);
      $eod_total_report_data = $this-&gt;eod_data-&gt;get_eod_total_report_data($where_array);
  
      $formated_eod_report_data = $this-&gt;format_eod_report_array($eod_report_data);
      krsort($formated_eod_report_data);
  
      $formated_eod_all_report_data= $this-&gt;format_all_eodreport_array($eod_total_report_data);
      krsort($formated_eod_all_report_data);
  
      $data = array('eod_data'=&gt;$formated_eod_report_data,'eod_all_data'=&gt;$formated_eod_all_report_data);
  
      $html = $this-&gt;load-&gt;view('eod-report-partial',$data,true);
  
      echo  json_encode($html);
  }
  </code></pre>
  
  <p><code>eod-report-partial</code> view</p>
  
  <pre><code>&lt;table width="100%" align="center" border="1"&gt;
  &lt;thead&gt;
      &lt;tr&gt;
       &lt;td&gt;ShopCode&lt;/td&gt;
        &lt;td&gt;Submitted By&lt;/td&gt;
        &lt;td&gt;RMS&lt;/td&gt;
        &lt;td&gt;ORM&lt;/td&gt;
        &lt;td&gt;ORM Profit&lt;/td&gt;
        &lt;td&gt;Total&lt;/td&gt;  
        &lt;td&gt;Cash&lt;/td&gt;
        &lt;td&gt;Card&lt;/td&gt;
        &lt;td&gt;Opening Balance&lt;/td&gt;
        &lt;td&gt;Purchase Today&lt;/td&gt;       
        &lt;td&gt;Final Total&lt;/td&gt;
        &lt;td&gt;T.Till Cash&lt;/td&gt;
        &lt;td&gt;Difference&lt;/td&gt;      
        &lt;td&gt;Nxt Day Op&amp;nbsp;Balance&lt;/td&gt;
        &lt;td&gt;Petty Cash&lt;/td&gt;
        &lt;td&gt;Banking&lt;/td&gt;  
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
  
  &lt;?php foreach($eod_data as $key=&gt;$eods)  {?&gt;
      &lt;tr&gt;&lt;td colspan="8""&gt;&lt;?php echo $key; ?&gt;&lt;/tr&gt;
      &lt;?php foreach($eods as $eod) { ?&gt;
      &lt;tr&gt;
       &lt;td&gt;&lt;?php echo $eod['shop_code']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod['first_name']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod['rms_sell'];?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod['orm_repair']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod['orm_repair'];?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod['total']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod['cash']; ?&gt;&lt;/td&gt;  
        &lt;td&gt;&lt;?php echo $eod['card']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod['opening_bal']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod['purchases']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod['final_total']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod['till_total']; ?&gt;&lt;/td&gt;       
        &lt;td&gt;&lt;?php echo $eod['difference']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod['nextday_opening_bal']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;      
        &lt;td&gt;&lt;?php echo $eod['banking']; ?&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
  &lt;?php  } ?&gt;
      &lt;tr&gt;
       &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;Total:&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod_all_data[$key]['sum_rms_sell'];?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod_all_data[$key]['sum_orm_repair']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod_all_data[$key]['sum_orm_repair'];?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod_all_data[$key]['total']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod_all_data[$key]['sum_cash']; ?&gt;&lt;/td&gt;  
        &lt;td&gt;&lt;?php echo $eod_all_data[$key]['sum_card']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod_all_data[$key]['sum_opening_bal']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod_all_data[$key]['sum_purchases']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod_all_data[$key]['final_total']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod_all_data[$key]['sum_till_total']; ?&gt;&lt;/td&gt;       
        &lt;td&gt;&lt;?php echo $eod_all_data[$key]['difference']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $eod_all_data[$key]['sum_next_day_bal']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;      
        &lt;td&gt;&lt;?php echo $eod_all_data[$key]['sum_banking']; ?&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;?php } ?&gt;
  
  &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>the problem is the view rendering to the page is</p>
  
  <p><img src="https://i.stack.imgur.com/phiEl.png" alt="enter image description here"></p>
  
  <p>how to render my html properly , thanks in advance</p>