I am using datatables for my pagination.When there are more than 5 records I want to show next,previous buttons and show number of pages drop down.

For that I am using like this

```
if($("#example").find("tr:not(.ui-widget-header)").length<=10){
            console.log('hi');
            $('#example_length').addClass('hide');
            $('#example_paginate').addClass('hide');

        }
    }

```

[enter link description here](http://jsfiddle.net/71zcn578/6/)
Lets say initially there are only 5 records so there is no need to show next or previous buttons neither number of records per page.

So I am hiding it and it works well.But my problem is if there are 12 records then on the 1st page it shows 10 records and next,previuos buttons all visible and when I click next button then it shows another 2 records and here the buttons disappear.

Now the user can not see 1-10 records as there is no button for that

So how to overcome this issue.

How can I disable the buttons if the total number of records are less than 10

Here is the fiddle