Skip to content

Instantly share code, notes, and snippets.

@wagnerpinheiro
Created July 17, 2020 01:49
Show Gist options
  • Save wagnerpinheiro/06c21548bc31aba62181074fe72852dd to your computer and use it in GitHub Desktop.
Save wagnerpinheiro/06c21548bc31aba62181074fe72852dd to your computer and use it in GitHub Desktop.
var body=document.body,
parent=body.querySelector(".JTable"),
rows=parent.querySelectorAll(".JTable-row"),
table=document.createElement("table"),
tbody=document.createElement("tbody"),
row=document.createElement("tr"),
cell=document.createElement("td"),
x=rows.length,
cells=rows[0].querySelectorAll(".JTable-cell"),
y=cells.length,
i,j;
table.appendChild(tbody)
for(i=0;i<x;i++){
row=row.cloneNode(0);
cells=rows[i].querySelectorAll(".JTable-cell");
y=cells.length;
for(j=0;j<y;j++){
cell=cell.cloneNode(0);
cell.innerHTML=cells[j].innerHTML;
row.appendChild(cell);
}
tbody.appendChild(row);
}
body.appendChild(table);
parent.style.display = "none";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment