This commit is contained in:
parent
15676b2433
commit
968cc47df2
1 changed files with 9 additions and 1 deletions
|
@ -258,7 +258,15 @@ export class Preview {
|
|||
private processZHTable(element: HTMLElement) {
|
||||
element.querySelectorAll("table").forEach(item => {
|
||||
const headElement = item.querySelector("thead");
|
||||
item.querySelector("tbody").insertAdjacentElement("afterbegin", headElement.firstElementChild);
|
||||
if (!headElement) {
|
||||
return;
|
||||
}
|
||||
const tbodyElement = item.querySelector("tbody");
|
||||
if (tbodyElement) {
|
||||
tbodyElement.insertAdjacentElement("afterbegin", headElement.firstElementChild);
|
||||
} else {
|
||||
item.innerHTML = `<tbody>${headElement.innerHTML}</tbody>`;
|
||||
}
|
||||
headElement.remove();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue