5

I am using the jQuery DataTables plugin (version 1.9.4) and would like to change the color of the pagination.

With CSS I am able to change their background color but I couldnt find a way to change the font color and font hover color for the anchor tags. I would like to change both font color and hover font color for all the below anchor tags to white (#FFFFFF).

The pagination code looks as follows:

<div id="myTable_paginate" class="dataTables_paginate paging_full_numbers">
    <a id="myTable_first" class="first paginate_button paginate_button_disabled" tabindex="0">First</a>
    <a id="myTable_previous" class="previous paginate_button paginate_button_disabled" tabindex="0">Previous</a>
    <span>
        <a class="paginate_active" tabindex="0">1</a>
        <a class="paginate_button" tabindex="0">2</a>
    </span>
    <a id="myTable_next" class="next paginate_button" tabindex="0">Next</a>
    <a id="myTable_last" class="last paginate_button" tabindex="0">Last</a>
</div>

Thanks for any help with this, Tim.

2
  • 1
    inspect each element in browser console , can see all rules that apply and live edit them. Find what works and copy to file Commented Nov 24, 2013 at 23:35
  • Thanks - how do i do that ? Commented Nov 25, 2013 at 0:46

3 Answers 3

7

Maybe you miss the !important declaration? In this case it is indeed important.

.paging_full_numbers a.paginate_button {
    color: #fff !important;
}
.paging_full_numbers a.paginate_active {
    color: #fff !important;
}

jsfiddle -> http://jsfiddle.net/CrBkT/

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

1 Comment

Awesome - I would never have thought of that and it works. Thanks a lot ! :)
7

after a bit of messing about this is what i got to work;

    .page-item.active .page-link {
        color: #fff !important;
        background-color: #000 !important;
        border-color: #000 !important; 
    }

    .page-link {
        color: #000 !important;
        background-color: #fff !important;
        border: 1px solid #dee2e6 !important; 
    }

    .page-link:hover {
        color: #fff !important;
        background-color: #000 !important;
        border-color: #000 !important; 
    }

Comments

0

Another answer is here:

$.fn.dataTable.ext.classes.sPageButton = 'your class';

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.