jQuery plugin DataTables: How to highlight the current search text?

前端 未结 5 1073
青春惊慌失措
青春惊慌失措 2020-11-30 10:42

I have started using the DataTables plugin (v1.6.2) for jQuery(v1.4.2), and I would like to ask you if you know a settings

5条回答
  •  清歌不尽
    2020-11-30 11:01

    I would have to suggest the highlight plugin :)

    I'm using this in about the same scenario right now, it's given me no issues thus far.

    The usage is pretty simple:

    $("#myTable").highlight($("#searchBox").val());
    

    Just put the highlight CSS class in your stylesheet styles like you want and that's it:

    .highlight { background-color: yellow }
    

提交回复
热议问题