title: Export to excel function not working
body: <p>Somsone have recommanded i use this function to export my data table to excel but it exports the HTML not just the data in the table. How can I make it export the data and the formatting(width, colour...) only?</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;script&gt;
  function ExportHTMLTableToExcel()
  {
     var thisTable = document.getElementById("table").innerHTML;
     window.clipboardData.setData("Text", thisTable);
     var objExcel = new ActiveXObject ("Excel.Application");
     objExcel.visible = true;
  
     var objWorkbook = objExcel.Workbooks.Add;
     var objWorksheet = objWorkbook.Worksheets(1);
     objWorksheet.Paste;
     alert('test');
  
  }
  &lt;/script&gt;
    &lt;title&gt;Java Friends&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;table id="table" style="font-weight: bold"&gt;
      &lt;tr style="background-color:red"&gt;&lt;td&gt;a&lt;/td&gt;&lt;td&gt;b&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;
        &lt;td colspan="2"&gt;
          &lt;button onclick="ExportHTMLTableToExcel()"&gt;
              Get as Excel spreadsheet
          &lt;/button&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;    
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Note: this function only works in IE if the security options <code>download unsigned activex control</code> and <code>download signed activex control</code> are set to 'enable'</p>