ody > tr');
    rows.forEach(row => {
        height += row.offsetHeight;
    });
    
    height += getVerticalMargins(table) + 10;

    window.parent.postMessage({ type: 'iframeHeight', height: Math.ceil(height) }, '*');
}

function getVerticalMargins(element) {
    const style = getComputedStyle(element);
    return parseFloat(style.marginTop) + parseFloat(style.marginBottom);
}

function repeatHeightCalculation(maxRetries = 10, interval = 100) {
    let retries = 0;
    const intervalId = setInterval(()