511
Views
7
Comments
Conditional set table row border color
Question

I want to set the a table row border color based on the record data condition. That is if a flag in the table is set to "Y" change the border color to red. I tried setting the table row extended properties using the class If (condition, "border-color: red","").

Thanks




2026-01-14 17-10-14
Bruno Gonçalves

Hi,

if you add an "!important" does it work?

2020-03-05 14-29-02
José Costa

Hi Kevin,

"using the class"?

I think what you want is the style:

(you could also use the class but not with that syntax)

And don't forget to refresh the table using the Ajax-Refresh to rerender the table.

(I'm assuming you are using the Traditional Web)

Cheers,

José

UserImage.jpg
Kevin Perkins

Jose

My condition is 

If (CFNamesAddrTable.List.Current.CFNamesAddr.DECEASED_FLAG = "Y","border-color:red","")

It is on the ROW extended prosperities style = 

the DECEASE_FLAG is in the table. Not all record have it set to "Y".

The table is going through Ajax Refresh on a search . 

Kevin






2026-01-14 17-10-14
Bruno Gonçalves

When you inspect the page does the style appear where you expect it? Or is it completely missing?

2020-03-05 14-29-02
José Costa

Hi Kevin,

I've misread your question. I thought you wanted the whole table. Sorry...

So, let's start again... :)

The borders should be set in the cells and not in the rows. The best way (I think) in this case is to use classes.

Thus, set a conditional class in the rows that you want red:

Then, set something like this in the CSS of the Screen:

.TableRecords .highlightred td{
    border-bottom: 1px solid red;
    border-top: 1px solid red;
}

.TableRecords .highlightred td:first-child{
    border-left: 1px solid red;
}

.TableRecords .highlightred td:last-child{
    border-right: 1px solid red;
}

This will set the cells of the rows that have that class with the right border color.

Can you try this and let me know?

Cheers,

José

UserImage.jpg
Kevin Perkins

José Costa wrote:

Hi Kevin,

I've misread your question. I thought you wanted the whole table. Sorry...

So, let's start again... :)

The borders should be set in the cells and not in the rows. The best way (I think) in this case is to use classes.

Thus, set a conditional class in the rows that you want red:

Then, set something like this in the CSS of the Screen:

.TableRecords .highlightred td{
    border-bottom: 1px solid red;
    border-top: 1px solid red;
}

.TableRecords .highlightred td:first-child{
    border-left: 1px solid red;
}

.TableRecords .highlightred td:last-child{
    border-right: 1px solid red;
}

This will set the cells of the rows that have that class with the right border color.

Can you try this and let me know?

Cheers,

José

Jose 

I use style and it work fine. Thank you.

Kevin



2020-03-05 14-29-02
José Costa

Kevin Perkins wrote:

I use style and it work fine. Thank you.

Good to know.

Cheers,

José

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.