如何在 YUI DataTable 中以不同颜色显示字符串的每个单词?
我需要“标记”颜色为蓝色,“好”颜色为红色。
http://i.stack.imgur.com/OSlvc.png
<script>
YUI().use("datatable", function(Y) {
var records = [
{ item: "widget", cost: 23.57, price: 47.5 },
{ item: "gadget", cost: 0.11, price: "Mark is good " },
{ item: "sprocket", cost: 4.08, price: 3.75 }
];
var table = new Y.DataTable({
columns: ["item","cost", "price"],
data: records
});
table.render("#example");
});
</script>