title: Copy table with borders doesn't work in Firefox
body: <p>I am trying to copy a table using <code>document.execCommand</code>. The copying works, but the borders and background color are missing when I paste in an email client. This is happening only when I copy it from Firefox; Chrome works fine.</p>
  
  <p>Any ideas on how to fix this issue for Firefox without external plugins and without using inline styles for the existing table?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function selectElementContents() {
    var el = document.getElementById('div1');
    // Copy textarea, pre, div, etc.
    var range = document.createRange();
    range.selectNodeContents(el);
    var sel = window.getSelection();
    sel.removeAllRanges();
    sel.addRange(range);
    try {
      var successful = document.execCommand('copy');
      var msg = successful ? 'successful' : 'unsuccessful';
      console.log('Copy command was ' + msg);
    } catch (err) {
      console.log('Oops, unable to copy');
    }
  
  } // end function selectElementContents(el)</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.table {
    background-color: #faa835;
    border: 2px solid black;
    border-collapse: collapse;
  }
  
  .table th {
    border: 2px solid black
  }
  
  .table td {
    border: 2px solid black
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;button id="copy" onclick="selectElementContents()"&gt;Copy&lt;/button&gt;
  &lt;div id="div1"&gt;
    &lt;table class="table"&gt;
      &lt;tr&gt;
        &lt;th&gt;Not working table&lt;/th&gt;
        &lt;th&gt;1&lt;/th&gt;
        &lt;th&gt;2&lt;/th&gt;
        &lt;th&gt;3&lt;/th&gt;
        &lt;th&gt;4&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Not working table&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;3&lt;/td&gt;
        &lt;td&gt;4&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://codepen.io/anon/pen/bPzmvW" rel="nofollow noreferrer">View on CodePen</a></p>