title: add :before to an object javascript
body: <p>Am trying to add a :before to a td element in my table with content same as the value as the th in the same column, i got to the point where i can change the value of the td but im stuck at adding the :before, here is my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function myFunction() {
    var rows = document.getElementsByTagName("table")[0].rows;
    var last = rows[0];
    var first = rows[1];
  
    for (i = 0; i &lt; 2; i++) {
      var cell = last.cells[i];
      var value = cell.innerHTML;
      alert(value);
      first.cells[i].innerHTML = value;
  
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;aa&lt;/th&gt;
        &lt;th&gt;bb&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&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&gt;3&lt;/td&gt;
        &lt;td&gt;4&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  
  &lt;button onclick="myFunction()"&gt;Test&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>