Quantcast
Channel: FixedColumns — DataTables forums
Viewing all articles
Browse latest Browse all 97

Fix for FixedColumns + FixedHeader without scrolling

$
0
0

FixedColumns has been compatible with FixedHeader since the release of FixedColumns 4. There is an example of the 2 working together, with both header and footer, at https://datatables.net/extensions/fixedcolumns/examples/integration/fixedHeaderFooter.html

However, if you don't also use scrolling (scrollX / scrollY), the cells in the table header and footer are not fixed horizontally.

After many hours I finally figured out how to solve it with this css:

th.dtfc-fixed-left {
  background-color: white;
  top: 0; /* for the header */
  bottom: 0; /* for the footer */
  z-index: 3 !important;
}

Tested in Chrome and Firefox with FixedColumns 4.1.0 and either FixedHeader 3.1.9 or 3.2.3.

Here's a demo: http://live.datatables.net/nujapafu/1/edit

Perhaps this is something that could be incorporated in the Datatables code?


Viewing all articles
Browse latest Browse all 97

Trending Articles