Ho to add class to column dynamically using jQuery datatable
By Tan Lee Published on Feb 16, 2024 1.36K
This post shows you how to add class to column using jquery datatable.net
jquery datatable add class to td
You can use className to assign a class to the cells in the specified column.
"aoColumnDefs": [ { "data": "id", "aTargets": [0] }, { "data": "active", "className": "text-center", "aTargets": [1], "mRender": function (data, type, row) { if (data === true) return '<label><input type="checkbox" disabled class="ace-checkbox" checked></label>'; else return '<label><input type="checkbox" disabled class="ace-checkbox"></label>'; } } ],
You can easily use className to add class to td dynamically using jquery datatable.
- How to add class to tr using jQuery datatable
- How to disable sorting with jquery datatable
- How to hide “Showing 1 of N Entries” with jQuery datatables
- How to Change parameter used in datatables ajax url.Action on Ajax.reload
- How to fix 'Requested unknown parameter '6' for row 0, column 6'
- How to Add new row to datatable using jquery datatable
- How to remove no data available in table from datatable in jQuery
- How to Rename “show XX entries” dropdown in DataTables
Categories
Popular Posts
Structured Data using FoxLearn.JsonLd
Jun 20, 2025
Implement security headers for an ASP.NET Core
Jun 24, 2025
10 Common Mistakes ASP.NET Developers Should Avoid
Dec 16, 2024
HTML Bootstrap 4 Login, Register & Reset Template
Nov 11, 2024