I'm using the latest version of jquery data table in my project, but the pagination is not showing in my table.

The css is ok and I'm using jquery 1.7.

Jquery code:

$("#accessControlTable").dataTable({
            "pagingType": "full_numbers",
            "iDisplayLength": 10,
            "iDisplayStart": 1,
            "bSort": true,
            "bFilter": true,
            "bInfo": true,
            "bLengthChange": true,
            "oLanguage": {
                "sZeroRecords": "   ",
                "sSearch": "Buscar:",
                "oPaginate": {
                    "sFirst": "First",
                    "sPrevious": "Previous",
                    "sNext": "Next",
                    "sLast": "Last"
                }
            }
        });

Can anyone help?

有帮助吗?

解决方案

It looks like many of the features of DataTables don't work with JQuery 1.7. See this JSFiddle to switch between JQuery 1.7 and 1.8 easily. Everything works as expected in 1.8 and above but not in any previous versions. Is upgrading your version of JQuery possible?

I tested using the basic initialization.

HTML:

<table id='accessControlTable'>
    <thead>
        <tr>
            <th>col1</th>
            <th>col2</th>
            <th>col3</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>1</td>
            <td>2</td>
            <td>3</td>
        </tr>
        <tr>
            <td>3</td>
            <td>2</td>
            <td>1</td>
        </tr>
        <tr>
            <td>4</td>
            <td>5</td>
            <td>6</td>
        </tr>
        <tr>
            <td>7</td>
            <td>6</td>
            <td>5</td>
        </tr>
    </tbody>
</table>

Javascript:

$("#accessControlTable").dataTable();
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top