Get started with datatables.net-fixedheader-bs5 CDN

MIT licensed

Datatables.net-fixedheader-bs5 is a plugin that enables fixed headers in Bootstrap 5 datatables.

Tags:
  • fixed headers
  • sticky
  • DataTables
  • jQuery
  • table
  • Bootstrap 5

Stable version

Copied!

How to start using datatables.net-fixedheader-bs5 CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with datatables.net-fixedheader-bs5 CDN - cdnhub.io</title>
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/fixedheader/4.0.1/css/fixedHeader.bootstrap5.min.css">
</head>
<body>
    <div class="container mt-5">
        <table id="example" 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>
                <tr>
                    <td>Tiger Nixon</td>
                    <td>System Architect</td>
                    <td>Edinburgh</td>
                    <td>54</td>
                    <td>2011/04/25</td>
                    <td>$320,800</td>
                </tr>
                <!-- Add more rows here -->
            </tbody>
        </table>
    </div>

    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
    <script src="https://cdn.datatables.net/fixedheader/4.0.1/js/dataTables.fixedHeader.min.js"></script>
    <script src="https://cdn.datatables.net/fixedheader/4.0.1/js/dataTables.bootstrap5.min.js"></script>

    <script>
        $(document).ready(function() {
            $('#example').DataTable({
                fixedHeader: true
            });
        });
    </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!

All versions