user4287698
user4287698

Reputation:

DataTable : How to style filter result as type?

I am using a DataTable.

enter image description here

Upvotes: 0

Views: 96

Answers (1)

user4287698
user4287698

Reputation:

Thanks to @sdcr for pointing me to the right direction.

I accomplish that by doing the following :

1- Include JS CDN

<script src="//bartaz.github.io/sandbox.js/jquery.highlight.js" type="text/javascript"></script>
<script src="//cdn.datatables.net/plug-ins/f2c75b7247b/features/searchHighlight/dataTables.searchHighlight.min.js" type="text/javascript"></script>

2- Include CSS CDN

3- Add "searchHighlight": true as part of your setting.

My whole setting look like this :

// Setting to Inventory Table 
  $('#inventory').dataTable({

    "lengthMenu": [ 10 ] ,
    "bLengthChange": false,
    "searchHighlight": true

  });

My final result :

enter image description here

Upvotes: 1

Related Questions