How to add class to tr using jQuery datatable
By FoxLearn 2/16/2024 9:24:24 AM 43
This post shows you how to add a class name to jquery.datatables
datatables add class to tr
To add a class to the row
For example:
$('#table').dataTable( { "createdRow": function( row, data, dataIndex ) { $(row).addClass('label-warning'); } });
$('tr', row) will search for a tr element inside the row provided as context parameter. If you want to add a class to row with conditionally based on the row's data.
$('#table').dataTable( { "createdRow": function(row, data, dataIndex ) { if (data[4] == "X" ) { $(row).addClass('text-95 text-secondary'); } } } );
- How to fix 'Requested unknown parameter '6' for row 0, column 6'
- How to Add new row to datatable using jquery datatable
- Ho to add class to column dynamically using jQuery datatable
- How to hide “Showing 1 of N Entries” with jQuery datatables
- How to remove no data available in table from datatable in jQuery
- How to Change parameter used in datatables ajax url.Action on Ajax.reload
- How to Rename “show XX entries” dropdown in DataTables
- How to fix Buttons not showing with jQuery datatable bootstrap
Categories
Popular Posts
Visual Studio: Auto increment version
04/01/2024
What is ARM architecture?
04/01/2024
What Are RESTful Web Services?
02/19/2024