DataTables/FixedHeader — Issue #2: Allow to trust CSS for thead elements sizes
Author: evax
Created: 2012-02-16 18:48:24+00:00
State: open

Using FixedHeader (without DataTables, and only for thead) it appears the width computation of the overlay table elements is very often off by a few pixels (verified on Chrome/FF).

The quick fix in my case is to trust CSS for the width:

```diff
diff --git a/js/FixedHeader.js b/js/FixedHeader.js
index 7ec45d6..115abd9 100644
--- a/js/FixedHeader.js
+++ b/js/FixedHeader.js
@@ -674,6 +674,7 @@ FixedHeader.prototype = {
nTable.appendChild( nThead );

/* Copy the widths across - apparently a clone isn't good enough for this */
+ /*
jQuery("thead>tr th", s.nTable).each( function (i) {
jQuery("thead>tr th:eq("+i+")", nTable).width( jQuery(this).width() );
} );
@@ -681,6 +682,7 @@ FixedHeader.prototype = {
jQuery("thead>tr td", s.nTable).each( function (i) {
jQuery("thead>tr td:eq("+i+")", nTable).width( jQuery(this).width() );
} );
+ */
},

/*
```

It would be nice to have such a "trust CSS" init option.