Skip to content

Commit

Permalink
CSS Grid means we can lose horrible, hacky table behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
hcayless committed Jun 2, 2020
1 parent 0448ace commit e62c329
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/defaultBehaviors.js
Expand Up @@ -74,37 +74,6 @@ export default {
}],
["_", ["(",")"]]
],
"table": function(elt) {
let table = document.createElement("table");
table.innerHTML = elt.innerHTML;
if (table.firstElementChild.localName == "tei-head") {
let head = table.firstElementChild;
head.remove();
let caption = document.createElement("caption");
caption.innerHTML = head.innerHTML;
table.appendChild(caption);
}
for (let row of Array.from(table.querySelectorAll("tei-row"))) {
let tr = document.createElement("tr");
tr.innerHTML = row.innerHTML;
for (let attr of Array.from(row.attributes)) {
tr.setAttribute(attr.name, attr.value);
}
row.parentElement.replaceChild(tr, row);
}
for (let cell of Array.from(table.querySelectorAll("tei-cell"))) {
let td = document.createElement("td");
if (cell.hasAttribute("cols")) {
td.setAttribute("colspan", cell.getAttribute("cols"));
}
td.innerHTML = cell.innerHTML;
for (let attr of Array.from(cell.attributes)) {
td.setAttribute(attr.name, attr.value);
}
cell.parentElement.replaceChild(td, cell);
}
return table;
},
"teiHeader": function(e) {
this.hideContent(e, false);
},
Expand Down

0 comments on commit e62c329

Please sign in to comment.