のテキスト コンテンツのみを持つid
のを取得する必要があります。<td>
<td>
例えば:
.....
<tr>
<td id='hey'>Hello world!</td>
</tr>
....
"Hello world" というテキストを知っていれば、id
のを取得でき<td>
ますか?
/ * **** / みんなありがとう!提供されたソリューションをできるだけ早く試します!! 説明するために、私は OBIEE 11g を使用していて、サポートされていない総計にフォーマット条件を追加するスクリプトを作成しようとしていました。今まで私はこの解決策を思いつきました:
<script type="text/javascript">
var threshold = 10; // set the threshold
/*** Definizione colonne da formattare ***/
/*** Partire da 0 ***/
var colonneFormattate = new Array(2);
colonneFormattate[0] = 0;
colonneFormattate[1] = 2;
/************************************************/
var tds = document.getElementsByClassName('PTDT');
for(var td =0; td < colonneFormattate.length;td++){
var amount = (tds[colonneFormattate[td]].innerHTML.replace("€","")).replace(/ /g,'');
//alert(colonneFormattate[td]);
var lungh = amount.indexOf(",");
var novirgole = amount.substring(0,lungh);
var novirgole = novirgole.replace(/\./g,"");
var num = parseInt(novirgole);
if(num > threshold){
tds[colonneFormattate[td]].style.color = "green";
}else{
tds[colonneFormattate[td]].style.color = "red";
}
}
</script>
したがって、この場合、数値がしきい値よりも高い場合、総計は色付けされます。ユーザーにとってより簡単にするために、配列内で検索する列を定義してみてください。つまり、ユーザーが Turnover という名前の列をフォーマットしたい場合、必要な列をスクリプトに追加します。
あなたの提案を試してみます!そして、私はあなたに知らせます!
乾杯!