Skip to content

Commit

Permalink
951e0eb8c0065557f29fd79141479d0263d02d05 Fix: Tables with borders wou…
Browse files Browse the repository at this point in the history
…ld overflow when scrolling was enabled

https://datatables.net/forums/discussion/80424

Sync to source repo @951e0eb8c0065557f29fd79141479d0263d02d05
  • Loading branch information
dtbuild committed Jan 9, 2025
1 parent c53b82b commit 2a5e16e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
],
"src-repo": "http://github.com/DataTables/DataTablesSrc",
"last-tag": "2.2.0",
"last-sync": "c23b0484f8dcdd99930365dacd061940ab98f182"
"last-sync": "951e0eb8c0065557f29fd79141479d0263d02d05"
}
8 changes: 4 additions & 4 deletions js/dataTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -5485,15 +5485,15 @@

// If there is no width attribute or style, then allow the table to
// collapse
if ( tmpTable.width() < tableContainer.clientWidth && tableWidthAttr ) {
tmpTable.width( tableContainer.clientWidth );
if ( tmpTable.outerWidth() < tableContainer.clientWidth && tableWidthAttr ) {
tmpTable.outerWidth( tableContainer.clientWidth );
}
}
else if ( scrollY ) {
tmpTable.width( tableContainer.clientWidth );
tmpTable.outerWidth( tableContainer.clientWidth );
}
else if ( tableWidthAttr ) {
tmpTable.width( tableWidthAttr );
tmpTable.outerWidth( tableWidthAttr );
}

// Get the width of each column in the constructed table
Expand Down
2 changes: 1 addition & 1 deletion js/dataTables.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dataTables.min.mjs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions js/dataTables.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5450,15 +5450,15 @@ function _fnCalculateColumnWidths ( settings )

// If there is no width attribute or style, then allow the table to
// collapse
if ( tmpTable.width() < tableContainer.clientWidth && tableWidthAttr ) {
tmpTable.width( tableContainer.clientWidth );
if ( tmpTable.outerWidth() < tableContainer.clientWidth && tableWidthAttr ) {
tmpTable.outerWidth( tableContainer.clientWidth );
}
}
else if ( scrollY ) {
tmpTable.width( tableContainer.clientWidth );
tmpTable.outerWidth( tableContainer.clientWidth );
}
else if ( tableWidthAttr ) {
tmpTable.width( tableWidthAttr );
tmpTable.outerWidth( tableWidthAttr );
}

// Get the width of each column in the constructed table
Expand Down

0 comments on commit 2a5e16e

Please sign in to comment.