最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jQuery DataTables add country icons each column - Stack Overflow

programmeradmin1浏览0评论

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?

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?

Share Improve this question edited Sep 12, 2013 at 18:51 madth3 7,34412 gold badges52 silver badges74 bronze badges asked Apr 20, 2013 at 17:02 user1480019user1480019
Add a ment  | 

1 Answer 1

Reset to default 5

Use the fnRowCallback.

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

发布评论

评论列表(0)

  1. 暂无评论