title: Modify code to export HTML table to Excel
body: <p>I'm using <code>PHPExcel 1.8</code> in my application. What I want to do is to download my file <code>generated.html</code> and this is the content.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;PHPExcel&lt;/title&gt;
  &lt;style&gt;
  table, td, th {
    border: 1px solid black;
  }
  
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;table style="width:100%"&gt;
    &lt;tr&gt;
      &lt;td bgcolor="#FF0000"&gt;Jill&lt;/td&gt;
      &lt;td&gt;Smith&lt;/td&gt;    
      &lt;td&gt;50&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Jack&lt;/td&gt;
      &lt;td&gt;Paper&lt;/td&gt;    
      &lt;td&gt;123&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Eve&lt;/td&gt;
      &lt;td&gt;Jackson&lt;/td&gt;    
      &lt;td&gt;94&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor="#FF0000"&gt;John&lt;/td&gt;
      &lt;td&gt;Doe&lt;/td&gt;    
      &lt;td&gt;80&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>For now, I have <code>dl.php</code> to perform the download but <code>example.xls</code> doesn't have the styles and colors applied to it.</p>
  
  <pre><code>&lt;?php
  
  require_once 'PHPExcel-1.8/Classes/PHPExcel.php';
  
  $objReader = new PHPExcel_Reader_HTML();
  $objPHPExcel = @$objReader-&gt;load($file_path.'generated.html');
  
  header('Content-Type: application/vnd.ms-excel');
  header('Content-Disposition: attachment;filename="example.xls"');
  header('Cache-Control: max-age=0');
  
  $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
  $objWriter-&gt;save('php://output');
  </code></pre>
  
  <p>What modifications should I do?</p>