问题
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:
to this:
(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?
回答1:
Use the fnRowCallback
.
Refer this example from the datatables documentation http://datatables.net/release-datatables/examples/advanced_init/row_callback.html
来源:https://stackoverflow.com/questions/16122924/jquery-datatables-add-country-icons-each-column