fix:table paging

pr675
Hufe921 4 years ago
parent 08e963995d
commit cb0a891f09

@ -470,11 +470,11 @@ export class Draw {
let deleteStart = 0
let deleteCount = 0
let preTrHeight = 0
if (trList.length > 1) {
for (let r = 0; r < trList.length; r++) {
const tr = trList[r]
if (tr.tdList.length < 2) break
if (curPagePreHeight + rowMarginHeight + preTrHeight + tr.height > height) {
// 暂时不考虑跨列
// 是否跨列
if (element.colgroup?.length !== tr.tdList.length) {
deleteCount = 0
}
@ -485,6 +485,7 @@ export class Draw {
preTrHeight += tr.height
}
}
}
if (deleteCount) {
const cloneTrList = trList.splice(deleteStart, deleteCount)
const cloneTrHeight = cloneTrList.reduce((pre, cur) => pre + cur.height, 0)

Loading…
Cancel
Save