DataTables Head Tag Correct Definition

DataTables Head Tag Correct Definition

gzoanettigzoanetti Posts: 1Questions: 1Answers: 0

HI.
I'm starting to get a grip on DataTables (Which is really awesome) and I needed some help to define the head of a HTML document
correctly. I'm using responsive extension and I'm planning to add more of its features.
Thanks in advance and sorry for the n00bness.

    <head>
        <title>Plataforma - Gestión Humana</title>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <script src="js/jquery-3.1.0.js" type="text/javascript"></script>
        <script src="js/bootstrap.js" type="text/javascript"></script>
        <script src="js/dataTables.bootstrap.js" type="text/javascript"></script>
        <script src="js/dataTables.responsive.js" type="text/javascript"></script>
        <script src="js/responsive.bootstrap.js" type="text/javascript"></script>
        <script src="js/datatables.js" type="text/javascript"></script>
        <link rel="stylesheet" href="css/bootstrap.css" />
        <link rel="stylesheet" href="css/datatables.css" /> 
        <link rel="stylesheet" href="css/dataTables.bootstrap.css" />

        <script>
            $(document).ready(function() {
            $('#example').DataTable();
            } );
        </script>
        
    </head>

Answers

  • allanallan Posts: 63,815Questions: 1Answers: 10,517 Site admin

    You should include DataTables before loading any of the extensions. Moreover, I would strongly encourage you to forgo writing out each individual file yourself, and just use the download builder which will create the required includes for you, with the right files in the right order.

    Allan

This discussion has been closed.