datatables responsive table header issues

datatables responsive table header issues

sakthi1992sakthi1992 Posts: 2Questions: 2Answers: 0
edited January 2020 in Free community support

when i scroll vertically the header of the table will be fixed under the nav bar.. but the scroll bar will comes. and i scroll horizontally . the tables header only moves. the tbody will not moved.


This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586
    Answer ✓

    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

  • sakthi1992sakthi1992 Posts: 2Questions: 2Answers: 0

    Thanks for the quick reply

    i have attach the test case.
    thanks in advance.

    live.datatables.net/xiwumeko/1/edit

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    This is your CSS I would strongly recommend against:

    .table-responsive {
        display: block;
    

    You are making it a block display rather than a table. With that you are effectively implementing your own horizontal scrolling for the table. You can do that, but you'd need to apply any scrolling of the table body to the header as well.

    I would suggest instead you just use the scrolling options DataTables has built in and remove that CSS.

    Allan

This discussion has been closed.