diff --git a/classifier/js/preview.js b/classifier/js/preview.js index 4a39145..6f550ae 100644 --- a/classifier/js/preview.js +++ b/classifier/js/preview.js @@ -410,10 +410,18 @@ const workbook = XLSX.read(arrayBuffer, { type: 'array' }); container.innerHTML = ''; - + // Make the content area a height-constrained flex column so the table + // scroller below fills the viewport — its horizontal scrollbar then + // sits at the window bottom instead of at the bottom of a tall sheet. + container.style.display = 'flex'; + container.style.flexDirection = 'column'; + container.style.minHeight = '0'; + container.style.overflow = 'hidden'; + if (workbook.SheetNames.length > 1) { const tabs = previewWindow.document.createElement('div'); tabs.className = 'sheet-tabs'; + tabs.style.flexShrink = '0'; workbook.SheetNames.forEach((name, i) => { const tab = previewWindow.document.createElement('button'); tab.className = 'sheet-tab' + (i === 0 ? ' active' : ''); @@ -430,6 +438,7 @@ const tableContainer = previewWindow.document.createElement('div'); tableContainer.style.flex = '1'; + tableContainer.style.minHeight = '0'; // allow it to shrink so overflow scrolls tableContainer.style.overflow = 'auto'; container.appendChild(tableContainer);