You are viewing limited content. For full access, please sign in.

Question

Question

How can I put background color in the fields that are in a table, only one column

asked on July 25, 2022 Show version history

I need that , if my field have text Active the field paint color green , if is Inactive the field paint color red

 

I use JS but not function 

I do some test with one field in single line and If function but in the table is not function

 

This is my example if you have one idea help me please , Its Cloud

 

 

 

 

0 0

Replies

replied on July 25, 2022 Show version history

Should be the following. By using the method find on the table class, you can ensure that any other fields which happen to have the same class name are not included. Or just use a unique class name for your table fields and reference them directly. A class defined on a table field effects the entire column.

The !important is also important, specifying to override any built in style definitions

Changing the text color to white is usually required too, if your trying to make a field stand out with solid RGB colors.

$('.tableClass').find('.fieldClassName input').attr('style', 'background-color: #6699ff !important; color:white;');

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.