ScrollY locked header & align issue (example provided)

ScrollY locked header & align issue (example provided)

khaoskhaos Posts: 47Questions: 11Answers: 0

When using ScrollY the header becomes locked and will sometimes mis-align. The main issue is when scrolling horizontally the header does not move and if there are headers off screen you never see them.

HTML:
(example table from https://datatables.net/examples/basic_init/zero_configuration.html)

CSS:
td { white-space: nowrap; }
th { white-space: nowrap; }

js:
$("#example").DataTable({
dom: 'Bfrtip',
"scrollY": "35vh",
"scrollCollapse": true,
"paging": false
});

Example showing the issue:
http://jsfiddle.net/Cyberjetx/hgvtqxux/34/

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,205Questions: 1Answers: 10,415 Site admin
    Answer ✓

    You need to add scrollX: true if horizontal scrolling is going to be active as well.

    It should perhaps be automatically enabled is scrollY is enabled. I'll think about that.

    Allan

This discussion has been closed.