Created
July 30, 2022 22:26
-
-
Save lk-geimfari/48734dbebcd975cb0bad0b0e0abc853b to your computer and use it in GitHub Desktop.
datatables ajax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table id="example" class="display" cellspacing="0" width="75%"> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Position</th> | |
<th>Office</th> | |
<th>Extn.</th> | |
<th>Start date</th> | |
<th>Salary</th> | |
</tr> | |
</thead> | |
<tfoot> | |
<tr> | |
<th>Name</th> | |
<th>Position</th> | |
<th>Office</th> | |
<th>Extn.</th> | |
<th>Start date</th> | |
<th>Salary</th> | |
</tr> | |
</tfoot> | |
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$('#example').DataTable( { | |
"ajax": "https://s3-us-west-2.amazonaws.com/s.cdpn.io/730692/json.txt", | |
"columns": [ | |
{ "data": "name" }, | |
{ "data": "position" }, | |
{ "data": "office" }, | |
{ "data": "extn" }, | |
{ "data": "start_date" }, | |
{ "data": "salary" } | |
] | |
} ); | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script> | |
<script src="https://cdn.datatables.net/v/dt/dt-1.10.15/datatables.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://cdn.datatables.net/v/dt/dt-1.10.15/datatables.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment