Page 1 of 1

How to change text color and size in a table

Posted: 2020-06-27 14:19
by ushay
Hello,

here is my script:

<script>

$j(function(){
$j('.takalot-Status').each(function(){
var status = $j(this).text();
if(status == 'In service' ){
$j(this).css("background-color", "#00ff7f");
}
if(status == 'not in service!!!' ){
$j(this).css("border-color", "#ffa500");
}
})
})
</script>
<script>

i have managed in this script to change the color of the background and the border of one off the cells in my table.
but somehow i can't change the color of the text and i also wish to change it to BOLD, i have tried : "$j(this).css("border-color", "#ffa500");" but it dose'nt effect the text.

can someone please help?

Re: How to change text color and size in a table

Posted: 2020-06-27 18:59
by pbottcher
Hi,

for the text use

$j(this).children('a')

eg.

$j(this).children('a').css('font-weight',"bold")

Re: How to change text color and size in a table

Posted: 2020-06-27 21:49
by ushay
thank you very much, i will try it.

Re: How to change text color and size in a table

Posted: 2020-06-27 22:24
by ushay
thank you, it worked well!!!
if i may, one more question.
what if i want to change the color of one of the headlines in the TableHeader?
how sould query it? i wish to change it to red color.