Skip to content
Advertisement

Datatables js: custom css

I’m using Datatables.js with Laravel. I’m post a request with ajax and I want to show the returned response in the table. Is there a way to customize this table? Can we customize the tags by giving them an id or class name? I tried this but didn’t get any results.

For example: I want to make the text color in the first column green or I want to add a photo next to the text in the second column.

JavaScript
JavaScript

Advertisement

Answer

You can change the text colour simply using css.

To add an image, you can add a custom render function as below:

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement