Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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

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

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

datatable in c#

String[] arr = new String[] { "a", "b" };
            DataTable dt = new DataTable();
            dt.Columns.Add("name");
            dt.Columns.Add("other");
            dt.Rows.Add(arr);

            foreach (DataRow r in dt.Rows)
            {
                Console.WriteLine(r["name"].ToString() + " - " + r["other"].ToString());
            }
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 :: javascript append to array 
Javascript :: add jwt token in header 
Javascript :: discord.js how to edit a message 
Javascript :: readonly vs disabled 
Javascript :: How to fix WordPress jQuery is not defined 
Javascript :: queryselector a tag with text 
Javascript :: how to use react router 
Javascript :: set value array input jquery 
Javascript :: format date month day year javascript 
Javascript :: Nuxt: Nuxt auth not redirecting after logout 
Javascript :: es6 map usin index 
Javascript :: how to reset settimeout in javascript 
Javascript :: js toggle value 
Javascript :: joi or null 
Javascript :: remove double slash from url javascript 
Javascript :: declare empty object javascript 
Javascript :: Reading Time with jquery 
Javascript :: disable button click jquery 
Javascript :: javascript capitalize first letter of each word 
Javascript :: Codewars JS Multiples of 3 or 5 
Javascript :: moment timezone get timezone offset 
Javascript :: jquery move li to first position 
Javascript :: checkbox change event javascript 
Javascript :: TypeError: client.guilds.forEach is not a function 
Javascript :: how to handle all error of all router in express 
Javascript :: js get id value 
Javascript :: split sentence in array js 
Javascript :: jquery on click fade out element 
Javascript :: validate password regex 
Javascript :: django jquery 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =