feat: copy and paste table cell background color
This commit is contained in:
@@ -89,6 +89,9 @@ export function writeElementList(elementList: IElement[], options: DeepRequired<
|
|||||||
tdDom.rowSpan = td.rowspan
|
tdDom.rowSpan = td.rowspan
|
||||||
const childDom = buildDomFromElementList(zipElementList(td.value!))
|
const childDom = buildDomFromElementList(zipElementList(td.value!))
|
||||||
tdDom.innerHTML = childDom.innerHTML
|
tdDom.innerHTML = childDom.innerHTML
|
||||||
|
if (td.backgroundColor) {
|
||||||
|
tdDom.style.backgroundColor = td.backgroundColor
|
||||||
|
}
|
||||||
trDom.append(tdDom)
|
trDom.append(tdDom)
|
||||||
}
|
}
|
||||||
tableDom.append(trDom)
|
tableDom.append(trDom)
|
||||||
@@ -341,6 +344,9 @@ export function getElementListByHTML(htmlText: string, options: IGetElementListB
|
|||||||
rowspan: tableCell.rowSpan,
|
rowspan: tableCell.rowSpan,
|
||||||
value: valueList
|
value: valueList
|
||||||
}
|
}
|
||||||
|
if (tableCell.style.backgroundColor) {
|
||||||
|
td.backgroundColor = tableCell.style.backgroundColor
|
||||||
|
}
|
||||||
tr.tdList.push(td)
|
tr.tdList.push(td)
|
||||||
})
|
})
|
||||||
if (tr.tdList.length) {
|
if (tr.tdList.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user