title: html table to excel with PHP
body: <p>I have looked for answer to other similar questions but couldn't see useful..</p>
  
  <p>I have an html table generated with php from mysql db. 
  I use this fragment in my php file to save as excel</p>
  
  <pre>
  $file="program.xls";
  header('Content-Type: text/html');
  $table = $_POST['tablehidden'];//i get this from another php file.It is HTML table
  header("Content-type: application/x-msexcel"); //tried adding  charset='utf-8' into header
  header("Content-Disposition: attachment; filename=$file");
  echo $table;
  </pre>
  
  <ol>
  <li>Till this time everything is ok. But when I save this i get character problem and tried to add  <em>charset='utf-8'</em> into my header, I don't know but It does not work. </li>
  <li>I have my table with style in HTML but when it comes to excel it lost the style which is implemented in css.</li>
  </ol>
  
  <p>How can I solve the charset and styling problems? I have looked at phpexcel but couldn't see a method to include a table directly.</p>