Get started with datatables.net-scroller-bs CDN

MIT licensed

Datatables.net scroller-bs: plugin for infinite scrolling, fixed headers in Bootstrap tables.

Tags:
  • virtual scrolling
  • DataTables
  • jQuery
  • table
  • Bootstrap

Stable version

Copied!

How to start using datatables.net-scroller-bs CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with datatables.net-scroller-bs CDN - cdnhub.io</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.datatables.net/scroller/bs/latest/css/dataTables.scroller.bootstrap5.min.css">
</head>
<body>
    <div class="container mt-5">
        <table id="dataTable" class="table table-bordered table-striped">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Position</th>
                    <th>Office</th>
                    <th>Age</th>
                    <th>Start date</th>
                    <th>Salary</th>
                </tr>
            </thead>
            <tbody id="data-body">
            </tbody>
        </table>
    </div>

    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.datatables.net/1.13.2/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/scroller/bs/latest/js/dataTables.scroller.bootstrap5.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>

    <script>
        $(document).ready(function() {
            $('#dataTable').DataTable({
                ajax: 'https://jsonplaceholder.typicode.com/users',
                columns: [
                    { data: 'name' },
                    { data: 'position.title' },
                    { data: 'office.city' },
                    { data: 'age' },
                    { data: 'start_date' },
                    { data: 'salary' }
                ],
                deferRender: true,
                scroller: true,
                lengthChange: false,
                paging: false,
                info: false,
                ordering: false,
                searching: false,
                autoWidth: false
            });
        });
    </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!

All versions