Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCType html>
- <head>
- <link href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">
- <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
- </head>
- <body>
- <table id="datatablemasters" class="table table-striped table-bordered hover order-column" width="100%" cellspacing="0">
- <thead>
- <tr>
- <th>Country Sno</th>
- <th>Country Code</th>
- <th>Country Name</th>
- <th>Description</th>
- <th>Action</th>
- </tr>
- </thead>
- </table>
- <script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
- <script>
- $(document).ready(function(){
- $('#datatablemasters').dataTable( {
- "bProcessing": true,
- "ajax": 'post.php',
- dom: 'Bfrtip',
- buttons: ['csv', 'excel', 'pdf'],
- responsive: true,
- "columnDefs": [ {"targets": [0],"visible": false,"searchable": false},
- {width: 100, targets: 4}]
- });
- });
- </script>
- </body>
- </html>
- // post.php
- <?php
- $array = [['Country Sno1','Country Code1','Country Name1','Description1','Action1'],
- ['Country Sno2','Country Code2','Country Name2','Description2','Action2'],
- ['Country Sno3','Country Code3','Country Name3','Description3','Action3'],
- ['Country Sno4','Country Code4','Country Name4','Description4','Action4']];
- $data = ['data'=>$array];
- echo json_encode($data);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement