🎨 Remove the colspan and rowspan attributes from cell elements after splitting cells https://github.com/siyuan-note/siyuan/issues/17050#issue-3943488883 (#17094)

This commit is contained in:
Jeffrey Chen 2026-03-07 10:58:07 +08:00 committed by GitHub
parent 990ff0ec5e
commit 96afa13bfe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2154,16 +2154,16 @@ export const tableMenu = (protyle: IProtyle, nodeElement: Element, cellElement:
let colSpan = orgColSpan;
while (colSpan > 0 && currentCellElement) {
currentCellElement.classList.remove("fn__none");
currentCellElement.colSpan = 1;
currentCellElement.rowSpan = 1;
currentCellElement.removeAttribute("colspan");
currentCellElement.removeAttribute("rowspan");
currentCellElement = currentCellElement.nextElementSibling as HTMLTableCellElement;
colSpan--;
}
currentRowElement = currentRowElement.nextElementSibling;
rowSpan--;
}
cellElement.rowSpan = 1;
cellElement.colSpan = 1;
cellElement.removeAttribute("colspan");
cellElement.removeAttribute("rowspan");
if (cellElement.tagName === "TH") {
let prueTrElement: HTMLElement;
Array.from(nodeElement.querySelectorAll("thead tr")).find((item: HTMLElement) => {