mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-15 11:38:06 +01:00
This commit is contained in:
parent
d343137415
commit
002b5adf16
1 changed files with 4 additions and 3 deletions
|
|
@ -76,7 +76,7 @@ export const insertRow = (protyle: IProtyle, range: Range, cellElement: HTMLElem
|
|||
|
||||
let rowHTML = "";
|
||||
for (let m = 0; m < cellElement.parentElement.childElementCount; m++) {
|
||||
rowHTML += `<td align="${cellElement.parentElement.children[m].getAttribute("align") || ""}"> </td>`;
|
||||
rowHTML += `<td align="${cellElement.parentElement.children[m].getAttribute("align") || ""}"></td>`;
|
||||
}
|
||||
let newRowElememt: HTMLTableRowElement;
|
||||
if (cellElement.tagName === "TH") {
|
||||
|
|
@ -113,10 +113,11 @@ export const insertRowAbove = (protyle: IProtyle, range: Range, cellElement: HTM
|
|||
if (className === "fn__none") {
|
||||
hasNone = true;
|
||||
}
|
||||
// 不需要空格,否则列宽调整后在空格后插入图片会换行 https://github.com/siyuan-note/siyuan/issues/7631
|
||||
if (cellElement.tagName === "TH") {
|
||||
rowHTML += `<th class="${currentCellElement.className}" colspan="${currentCellElement.colSpan}" align="${currentCellElement.getAttribute("align")}"> </th>`;
|
||||
rowHTML += `<th class="${currentCellElement.className}" colspan="${currentCellElement.colSpan}" align="${currentCellElement.getAttribute("align")}"></th>`;
|
||||
} else {
|
||||
rowHTML += `<td class="${currentCellElement.className}" colspan="${currentCellElement.colSpan}" align="${currentCellElement.getAttribute("align")}"> </td>`;
|
||||
rowHTML += `<td class="${currentCellElement.className}" colspan="${currentCellElement.colSpan}" align="${currentCellElement.getAttribute("align")}"></td>`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue