0

In jQuery datatable, the horizontal scroll bar doesn't appears when I include bootstrap css. I know, some styles are overriding the datatable. Can someone help me, which style is creating the problem?

Demo

Script

$(document).ready(function() {
    $('#example').dataTable( {
        "sScrollX": "100%",
        "sScrollXInner": "110%",
        "bScrollCollapse": true
    });
});

Thanks in advance.

1 Answer 1

1

There is a style applied by bootstrap that allows max-width of the table to be 100%;

table {
    background-color: rgba(0, 0, 0, 0);
    max-width: 100%;
}

If you disable/erase this max-width then the scroll will appear. Or just overwrite the style for tables with:

table {
max-width: none !important;
}

Add the "!important" if your style doesn't overwrite bootstrap's style.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.