Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

New: Support for `box-sizing: border-box;`

- Setting `box-sizing: border-box;` for table cells would cause
  DataTables to incorrectly calculate the size of the element when
  applying the scrolling draw. This is because jQuery's $().width()
  always returns the content width (taking into account box-sizing).

- One possible fix was to detect the box model used and switch between
  width() and outerWidth(), but a much better fix is to use
  $().css('width') as this does take into account the box-model and
  allows DataTables to draw the scrolling table columns correctly,
  regardless of the box model. It should actually also improve
  performance, since jQuery doesn't need to look the box model up
  itself.

- This fixes issue #157
  • Loading branch information...
commit 95be4568eb5b50c01f18e12fd964e8d4ba23df33 1 parent 370a1e7
@DataTables authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 media/src/core/core.scrolling.js
View
4 media/src/core/core.scrolling.js
@@ -318,7 +318,7 @@ function _fnScrollDraw ( o )
// Read all widths in next pass. Forces layout only once because we do not change
// any DOM properties.
_fnApplyToChildren( function(nSizer) {
- aApplied.push( _fnStringToCss( $(nSizer).width() ) );
+ aApplied.push( _fnStringToCss( $(nSizer).css('width') ) );
}, anHeadSizers );
// Apply all widths in final pass. Invalidates layout only once because we do not
@@ -335,7 +335,7 @@ function _fnScrollDraw ( o )
_fnApplyToChildren( zeroOut, anFootSizers );
_fnApplyToChildren( function(nSizer) {
- aAppliedFooter.push( _fnStringToCss( $(nSizer).width() ) );
+ aAppliedFooter.push( _fnStringToCss( $(nSizer).css('width') ) );
}, anFootSizers );
_fnApplyToChildren( function(nToSize, i) {
Please sign in to comment.
Something went wrong with that request. Please try again.