Fixed and scrollable header without vertical scroll on table

Fixed and scrollable header without vertical scroll on table

SAVladImirCSAVladImirC Posts: 2Questions: 1Answers: 0

I want scrollable and fixed header on my dataTable, without vertical scroll on table. To be more precise, I'm achieving this only if scrollY:300, if I set other value, it is not working.
Here is my initialization of dataTabe:

this.table = new $('#mainTable').DataTable({
responsive: false,
paging: false,
searching: false,
lengthChange: false,
sorting:false,
pageLength: 200,
scrollY:300,
scrollX: true,
scrollCollapse: true,
fixedHeader: {
header: true,
},
})

Answers

  • colincolin Posts: 15,144Questions: 1Answers: 2,586

    It appears to be working here. If that doesn't help, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • SAVladImirCSAVladImirC Posts: 2Questions: 1Answers: 0

    Thank you for your response colin, I actually used that code initially, as you can see.

Sign In or Register to comment.