user1480019
user1480019

Reputation:

jQuery DataTables add country icons each column

I want to add in DataTables a country icon on each country column (with jQuery) which is the same as the text that is displayed on that column.

So when it contains the country US then there is a image before the text that will link to us.png.

So, from this:

Row without flag icons

to this:

Row with flag icons

(Edited in Chrome DevTools)

I think it can be done with aaData, but I don't know how to use that without replacing the whole column.

Somebody has an answer?

Upvotes: 6

Views: 12678

Answers (1)

Akshay
Akshay

Reputation: 3198

Use the fnRowCallback.

Refer this example from the datatables documentation http://datatables.net/release-datatables/examples/advanced_init/row_callback.html

Upvotes: 5

Related Questions