Can't get installation right

Can't get installation right

muuuchomuuucho Posts: 7Questions: 2Answers: 0

why is the following code not working (i just get a table witout css nor functionality):

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.12/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.12/js/jquery.dataTables.js"></script>
<script src="jquery-1.12.2.min.js"></script>
<script type="text/javascript">
$(document).ready( function () {
$('#table_id').DataTable();
} );
</script>
</head>

<body>

Column 1 Column 2
Row 1 Data 1 Row 1 Data 2
Row 2 Data 1 Row 2 Data 2

</body>

</html>

This question has an accepted answers - jump to answer

Answers

  • muuuchomuuucho Posts: 7Questions: 2Answers: 0

    I can see thet the table tags have disapeared, well they are in my html file.

  • allanallan Posts: 61,904Questions: 1Answers: 10,148 Site admin
    Answer ✓

    DataTables is a plug-in to jQuery. Therefore, you need to include it after jQuery. At the moment its probably giving all sorts of errors in your browser's console.

    Allan

  • muuuchomuuucho Posts: 7Questions: 2Answers: 0

    Thank you. What a fantastic thing, the DataTables!

This discussion has been closed.