Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

datatable setup

$('table').dataTable({
	lengthChange: false, //visable show {row} entries
	info : false, // hide showing entries bottom
    pagingType: "first_last_numbers", // showing bottom number
    searching: false, //hide search
    aLengthMenu: [[5, 10, 25, -1], [5, 10, 25, "All"]], // set show {row} entries
	iDisplayLength: 5 // num of rows
});
Comment

jquey datatables

HTML
1
2
3
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.4/css/jquery.dataTables.css">
  
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.11.4/js/jquery.dataTables.js"></script>
Comment

using datatable

//html
<table id="table" class="table table-striped table-bordered dt-responsive display nowrap" style="width: 100%!important;">
  <thead class="thead-light"></thead>
</table>

//js
var table = $('#table').DataTable({
    processing: true,
    searching : true,
    paging    : true,
    pageLength: 25,
    ordering  : false,
    data      : data,
    columns: [
        {data: 'id', title: '#'},
        {data: 'name', className: "text-center", title: 'Name'},
        {
          data: function(row){
            return "</a><a class='ui icon blue button' href='/name/view/" + row.id + "'><i class='fas fas fa-search'></i></a>&nbsp;&nbsp;&nbsp;<a class='ui icon blue button' href='/name/" + row.id + "'><i class='fas fa-pencil-alt'></i></a>"
          },
          searchable: false,
          orderable : false,
          className: "text-center",
          title: 'Actions'
        },
    ],
    lengthMenu: [
        [ 25, 50, -1 ],
        [ '25 rows', '50 rows', 'Show all' ]
    ]
  })

jQuery('.dataTable').wrap('<div class="dataTables_scroll" />');

//style
.dataTables_scroll
{
    overflow:auto;
}
Comment

datatable in html

1
2
3
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.21/css/jquery.dataTables.css">

<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.21/js/jquery.dataTables.js"></script>
Comment

DataTables

<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.4/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.11.4/js/jquery.dataTables.js"></script>
Comment

datatable

<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.22/datatables.min.css"/>
 
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.22/datatables.min.js"></script>
Comment

jquery datatable

HTML
1
2
3
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.5/css/jquery.dataTables.css">
  
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.js"></script>
Comment

jquery datatable

HTML
1
2
3
<link rel="stylesheet" type="text/css" href="/DataTables/datatables.css">
 
<script type="text/javascript" charset="utf8" src="/DataTables/datatables.js"></script>
Comment

datatables

datatable(m, escape = FALSE)
Comment

PREVIOUS NEXT
Code Example
Javascript :: get url from string javascript 
Javascript :: map method js 
Javascript :: ng2 validations angular using reactiveforms 
Javascript :: index localstorage object 
Javascript :: jest express testing 
Javascript :: how to write query string js 
Javascript :: time stamp to date js 
Javascript :: ajax laravel get values from form 
Javascript :: dark mode with react hooks 
Javascript :: How to get previous url in nextjs 
Javascript :: if () { } 
Javascript :: bootstrap modal close on form submit in react 
Javascript :: get index of first number in string javascript 
Javascript :: js editable table 
Javascript :: send audio with socket io node js 
Javascript :: copy on clip board 
Javascript :: javascript /g 
Javascript :: create a promise in javascript 
Javascript :: lodash remove not in array 
Javascript :: indefOf 
Javascript :: how to return json data from mvc controller to view 
Javascript :: javascript new date undefined 
Javascript :: react hook form password validation uppercase 
Javascript :: double click on element using javascript 
Javascript :: best javascript books 
Javascript :: javascript sets 
Javascript :: javascript execute function after async 
Javascript :: how to give path of file which in directory in require_once 
Javascript :: it each jest 
Javascript :: convert int to string javascript 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =