Get started with datatables.net-fixedheader-bs CDN

MIT licensed

Datatables.net-fixedheader-bs is a plugin that enables fixed headers in DataTables with Bootstrap styling.

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

Stable version

Copied!

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


<!DOCTYPE html>
<html>
<head>
    <title>Get started with datatables.net-fixedheader-bs CDN - cdnhub.io</title>
    <link rel="stylesheet" href="https://stack.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.datatables.net/fixedheader/4.0.1/css/fixedHeader.bootstrap.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.2.1.js"></script>
    <script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/fixedheader/4.0.1/js/fixedHeader.bootstrap.min.js" defer></script>

    <script>
        $(document).ready( function () {
            $('#example').DataTable({
                paging: false,
                lengthChange: false,
                searching: false,
                info: false,
                autoWidth: false,
                responsive: true,
                fixedHeader: true
            });
        });
    </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!

All versions