Is there a way to always displaying the y-scrollbar?

Is there a way to always displaying the y-scrollbar?

liralira Posts: 8Questions: 2Answers: 0
edited April 2016 in Free community support

Is there a way to always displaying the y-scrollbar?

Answers

  • liralira Posts: 8Questions: 2Answers: 0
    edited April 2016

    Is there a way to always displaying the y-scrollbar?

    DataTable (1.10.11)

    Code from DataTables debugger: ecokej

  • liralira Posts: 8Questions: 2Answers: 0

    bump

  • allanallan Posts: 63,786Questions: 1Answers: 10,511 Site admin

    Even when scrolling isn't required? Use CSS to achieve that:

    div.dataTables_scrollBody {
      overflow-x: auto;
      overflow-y: scroll;
    }
    

    You may need to remove the default overflow option from the DataTables default CSS or use CSS to override it.

    Allan

  • liralira Posts: 8Questions: 2Answers: 0

    Thanks! :-)
    I will try that.

  • liralira Posts: 8Questions: 2Answers: 0

    I´m not an expert on css so I´m not sure I´m doing this right, but when I look in jquery.dataTables.css for the overflow option, I can´t find any.

    In the html the overflow is set by an inline style.
    Like this:
    <div class="dataTables_scrollBody" style="position: relative; overflow: auto; width: 100%;">

    Where does that inline style come from? Can I change it somehow or do I have to use !impotant in my own css?

This discussion has been closed.