style(table): optimize for 1920x1080 without horizontal scroll

- Switched to fixed table layout to ensure fit within viewport
- Implemented automatic ellipsis (...) for overflowing text in all cells
- Synchronized cell widths and alignment in ListFactory with column definitions
- Removed restrictive min-widths that caused horizontal scrolling
This commit is contained in:
2026-06-18 20:41:03 +09:00
parent aab1f91d3d
commit c0ef52deac
2 changed files with 9 additions and 7 deletions

View File

@@ -41,7 +41,7 @@ table {
width: 100%; width: 100%;
border-collapse: separate; border-collapse: separate;
border-spacing: 0; border-spacing: 0;
table-layout: auto; table-layout: fixed; /* Force fixed layout to prevent horizontal scroll */
} }
th, td { th, td {
@@ -49,6 +49,8 @@ th, td {
border-bottom: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
text-align: left; text-align: left;
white-space: nowrap; white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis; /* Show ... for long text */
} }
thead { thead {
@@ -86,11 +88,9 @@ tbody tr:hover {
/* 메모 컬럼 전용 */ /* 메모 컬럼 전용 */
.col-memo { .col-memo {
width: 25%; white-space: nowrap !important; /* Keep as one line */
min-width: 300px; overflow: hidden;
white-space: normal !important; text-overflow: ellipsis;
word-break: break-all;
line-height: 1.5;
} }
/* --- Table Sorting --- */ /* --- Table Sorting --- */

View File

@@ -749,7 +749,9 @@ export function createListView(container: HTMLElement, config: ListViewConfig) {
tbody.innerHTML = filtered.length === 0 ? `<tr><td colspan="${config.columns.length}" class="text-center empty-cell">${UI_TEXT.MESSAGES.NO_DATA}</td></tr>` tbody.innerHTML = filtered.length === 0 ? `<tr><td colspan="${config.columns.length}" class="text-center empty-cell">${UI_TEXT.MESSAGES.NO_DATA}</td></tr>`
: filtered.map(asset => `<tr class="asset-row clickable" data-id="${asset.id}">${config.columns.map(col => { : filtered.map(asset => `<tr class="asset-row clickable" data-id="${asset.id}">${config.columns.map(col => {
const isDateCol = col.header.includes('일') || col.header.includes('날짜') || col.header.includes('연월'); const isDateCol = col.header.includes('일') || col.header.includes('날짜') || col.header.includes('연월');
return `<td class="${isDateCol ? 'text-center' : ''}">${col.render(asset)}</td>`; const alignmentClass = col.align ? `text-${col.align}` : (isDateCol ? 'text-center' : '');
const customClass = col.className || '';
return `<td class="${alignmentClass} ${customClass}" style="${col.width ? `width:${col.width};` : ''}">${col.render(asset)}</td>`;
}).join('')}</tr>`).join(''); }).join('')}</tr>`).join('');
tbody.querySelectorAll('.asset-row').forEach((tr, idx) => { tr.addEventListener('click', () => config.onRowClick && config.onRowClick(filtered[idx])); }); tbody.querySelectorAll('.asset-row').forEach((tr, idx) => { tr.addEventListener('click', () => config.onRowClick && config.onRowClick(filtered[idx])); });