Ok let's look at this part of the code -
$(tbody).find('tr').each((i, oldTbodyTr) => {
    newTr = document.createElement('tr');
    $(oldTbodyTr).find('td').each((i, oldTd) => {
        let newTd = document.createElement('td');
        newTd.innerHTML = oldTd.innerHTML;
        newTd.classList = oldTd.classList;
        newTd.style = oldTd.style; //Doesn't work
        newTr.appendChild(newTd);
    });
    newTableTbody.appendChild(newTr);
});
It creates a new table body by looping through all rows in tbody of an already existing table.
Everything is fine, except that the style of the old td doesn't transfer to the new td element.
I can't figure out why.
 
     
    