Skip to content

Commit

Permalink
set minwidth on col elements
Browse files Browse the repository at this point in the history
  • Loading branch information
YousefED committed Oct 25, 2024
1 parent 44af218 commit d0e1247
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/tableview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,15 @@ export function updateColumnsOnResize(
totalWidth += hasWidth || cellMinWidth;
if (!hasWidth) fixedWidth = false;
if (!nextDOM) {
colgroup.appendChild(document.createElement('col')).style.width =
cssWidth;
const col = document.createElement('col');
col.style.width = cssWidth;
col.style.minWidth = cssWidth.length ? '' : cellMinWidth + 'px';
colgroup.appendChild(col);
} else {
if (nextDOM.style.width != cssWidth) nextDOM.style.width = cssWidth;
if (nextDOM.style.width != cssWidth) {
nextDOM.style.width = cssWidth;
nextDOM.style.minWidth = cssWidth.length ? '' : cellMinWidth + 'px';
}
nextDOM = nextDOM.nextSibling as HTMLElement;
}
}
Expand Down

0 comments on commit d0e1247

Please sign in to comment.