Skip to content

Instantly share code, notes, and snippets.

@jonathasrochadesouza
Last active January 20, 2021 19:27
Show Gist options
  • Save jonathasrochadesouza/709ae6f8aa5adfa28924f738c38af75b to your computer and use it in GitHub Desktop.
Save jonathasrochadesouza/709ae6f8aa5adfa28924f738c38af75b to your computer and use it in GitHub Desktop.
Example of how you can implement datatables in your project. Visit the official datatables page: https://datatables.net/manual/installation (Full Getting Started Guide)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Title </title>
<link rel="stylesheet" href="http://cdn.datatables.net/1.10.15/css/jquery.dataTables.min.css">
</head>
<body>
<main>
<table id="table_id" class="display datatable" >
<thead>
<tr>
<th> Info_1 </th>
<th> Info_2 </th>
<th> Info_3 </th>
<th> Info_4 </th>
</tr>
</thead>
<tr>
<td> Content </td>
<td> Content </td>
<td> Content </td>
<td> Content </td>
</tr>
</table>
</main>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js"></script>
<script>
$(document).ready(function() {
$('table').DataTable({
language: {
url: 'https://cdn.datatables.net/plug-ins/1.10.21/i18n/Portuguese-Brasil.json'
}
});
});
</script>
</html>
@jonathasrochadesouza
Copy link
Author

datatables dark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment