【发布时间】:2016-12-27 19:35:42
【问题描述】:
我正在尝试将此脚本插入 custom.js。我将所有负数货币更改为红色。
我希望它适用于打印在 Jupyter 上的所有 pandas 数据帧。将它添加到 jupyter/anaconda 文件夹上所有可用的 custom.js 后,它仍然没有改变任何东西。有人可以帮我吗?
var allTableCells = document.getElementsByTagName("td");
for(var i = 0, max = allTableCells.length; i < max; i++) {
var node = allTableCells[i];
//get the text from the first child node - which should be a text node
var currentText = node.childNodes[0].nodeValue;
//check for 'one' and assign this table cell's background color accordingly
if (currentText.includes("$ -"))
node.style.color = "red";
}
【问题讨论】:
标签: javascript python pandas anaconda jupyter