title: Print html page with internet explorer
body: <p>I have to print a table with its style
  So I'm using jQuery.copyCSS to clone its CSS,style into another element
  (Because I'm testing it on IE 8 and seems like it doesn't preserve CSS after clicking/calling window.print())
  <a href="https://github.com/moagrius/copycss" rel="nofollow noreferrer">https://github.com/moagrius/copycss</a></p>
  
  <p>I thought to "send" the table to another page and call from there the print.</p>
  
  <p>Thus I need to clone the css into another element (to pass on the second page)</p>
  
  <pre><code> $("#table_report").clone().attr({"id":"table_report_clone", "name":"clone"}).appendTo("body"); // doesn't matter if it appears on the page, I will just pass these one
  
      $('#table_report_clone').copyCSS('#table_report');  // copy CSS from original to clone
  
      var clone = $("#table_report_clone").html();
  
      var w = window.open();
      $(w.document.body).html(clone ); //table_report should be the table with its style
      w.document.close();
  </code></pre>
  
  <p>So, passing .html it will parse only the HTML not including the style</p>
  
  <p>How can I do that?</p>
  
  <p><strong>EDIT 1:</strong>
  Now some icons are being displayed..however the table is really 'raw'
  w.document.write(clone); // instead of  $(w.document.body).html(clone); </p>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p>Changed adding some tips by @Roljhon</p>
  
  <p>En fact this does work on FF, Chrome, but in <strong>IE 8 nope.</strong>.
  (Anyway I'm using JQuery 1.5.1)</p>
  
  <p><strong>dumpCSSText</strong> is a function from 
  <a href="https://stackoverflow.com/a/15011387/7370271">https://stackoverflow.com/a/15011387/7370271</a>
  since I have to get/join the styles attributes</p>
  
  <pre><code>        $("#table_report").inlineStyler();
          var table_report = document.getElementById("table_report");
  
          var w = window.open();
          var css = "" + dumpCSSText(table_report) //css of your table_content
  
          var style = document.createElement('style');
  
          style.type = "text/css";
          style.appendChild(document.createTextNode(css));
  
          w.document.head.appendChild(style);
          w.document.body.innerHTML = document.getElementById("table_report").innerHTML
  </code></pre>
  
  <p><strong>EDIT 3: Now it works</strong></p>
  
  <p>var table_report = $("#table_report").html();</p>
  
  <pre><code>        var w = window.open();
          w.document.write('&lt;html&gt;&lt;head&gt;&lt;link rel="stylesheet" href="/i/css/apex.min.css?v=4.2.6.00.03" type="text/css" /&gt;&lt;!--[if IE]&gt;&lt;link rel="stylesheet" href="/i/css/apex_ie.min.css?v=4.2.6.00.03" type="text/css"/&gt;&lt;![endif]--&gt;&lt;link rel="stylesheet" href="/i/libraries/jquery-ui/1.8.22/themes/base/jquery-ui.min.css" type="text/css" /&gt;&lt;/head&gt;&lt;body&gt;');
  
          $(w.document.body).html(table_report);
  
          w.document.write('&lt;/body&gt;&lt;/html&gt;');
          w.document.close();
          w.focus();
          w.print();
          w.close();
  </code></pre>
  
  <p>Finally I'm now at 90%..the only problem is CSS in IE8..</p>
  
  <p>Thank you</p>