Losing Pager styles after first click.

Losing Pager styles after first click.

smillersmiller Posts: 19Questions: 0Answers: 0
edited September 2013 in DataTables 1.9
I have the jQuery plugin working pretty good on my table with pretty much the defaults.

var oTable = $("#tblResults").dataTable({
"sPaginationType": "full_numbers",
"bJQueryUI": true
});

The pager was originally kind of smushed up so I added this jQuery line right after the above line:
$("div.dataTables_paginate a").css("color", "#024785").css("font-weight", "bold").css("padding", "7px");

It looks great on the first load.
But the minute I click any pager a button or any sort button, the numbers in the pager lose the styles in the above line.
The First, Next, Previous and Last button links do not lose their styles.
The only difference I can see in the html source between First,Next and so on and the page number links is that the numbers are in a span tag within the div.
But they already in the span tag on first load and the styles show ok then.

Anyone know why the only page number links in the pager lose their styles?

Replies

  • smillersmiller Posts: 19Questions: 0Answers: 0
    Here is my solution.
    I think it is working now.


    $(function () {
    var oTable = $("#tblResults").dataTable({
    "sPaginationType": "full_numbers",
    "bJQueryUI": true,
    "sScrollY": 200,
    "fnDrawCallback": function (oSettings) {
    addPagerCss();
    }
    });

    // Fix pager CSS
    addPagerCss();
    });

    function addPagerCss() {
    $("div.dataTables_paginate a").css("color", "#024785").css("font-weight", "bold").css("padding", "7px");
    }
This discussion has been closed.