Get started with datatables.net-buttons-dt CDN

MIT licensed

DataTables.net buttons plugin adds export buttons for tables.

Tags:
  • buttons
  • excel
  • pdf
  • csv
  • column visibility
  • print
  • jQuery
  • table
  • DataTables

Stable version

Copied!

How to start using datatables.net-buttons-dt CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with datatables.net-buttons-dt CDN - cdnhub.io</title>
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.5/css/jquery.dataTables.min.css">
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/3.0.1/css/buttons.dataTables.min.css">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.cdnhub.io/datatables.net-buttons-dt/3.0.1/buttons.dataTables.min.js"></script>
</head>
<body>
    <div class="container">
        <table id="example" class="display" style="width:100%">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Position</th>
                    <th>Office</th>
                    <th>Age</th>
                    <th>Start date</th>
                    <th>Actions</th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                    <th>Name</th>
                    <th>Position</th>
                    <th>Office</th>
                    <th>Age</th>
                    <th>Start date</th>
                    <th>Actions</th>
                </tr>
            </tfoot>
            <tbody id="example-data">
                <tr>
                    <td>Tiger Nixon</td>
                    <td>System Architect</td>
                    <td>Edinburgh</td>
                    <td>54</td>
                    <td>2011/04/25</td>
                    <td>
                        <button class="btn btn-primary btn-sm create-button" data-toggle="tooltip" data-placement="top" title="Create">
                            <i class="fa fa-plus"></i>
                        </button>
                        <button class="btn btn-warning btn-sm edit-button" data-toggle="tooltip" data-placement="top" title="Edit">
                            <i class="fa fa-pencil"></i>
                        </button>
                        <button class="btn btn-danger btn-sm delete-button" data-toggle="tooltip" data-placement="top" title="Delete">
                            <i class="fa fa-trash"></i>
                        </button>
                    </td>
                </tr>
                <!-- Add more data rows here -->
            </tbody>
        </table>
    </div>

    <script>
        $(document).ready(function() {
            $('#example').DataTable({
                dom: 'Bfrtip',
                buttons: [
                    'create', 'edit', 'delete'
                ]
            });
        });
    </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!

All versions