@@ -867,10 +867,16 @@ export const applyTableStyle = (document: Document) => {
|
||||
table.style.width = `calc(min(${computedWidth}, var(--available-width)))`;
|
||||
}
|
||||
}
|
||||
const parentWidth = window.getComputedStyle(parent as Element).width;
|
||||
const parentContainerWidth = parseFloat(parentWidth) || 0;
|
||||
if (totalTableWidth > 0) {
|
||||
const scale = `calc(min(1, var(--available-width) / ${totalTableWidth}))`;
|
||||
table.style.transformOrigin = 'left top';
|
||||
table.style.transform = `scale(${scale})`;
|
||||
} else if (parentContainerWidth > 0) {
|
||||
const scale = `calc(min(1, var(--available-width) / ${parentContainerWidth}))`;
|
||||
table.style.transformOrigin = 'center top';
|
||||
table.style.transform = `scale(${scale})`;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user