Как изменить цвет строки по индексуCSS

Разбираемся в CSS
Ответить
Anonymous
 Как изменить цвет строки по индексу

Сообщение Anonymous »


I have a table with cell editing using primeng which the data its completed by a API, so the table never has the same quantity of rows and the same order. I want to change the row color to red if the word size is wrong or green if the size is correct.

I think I need to take the index of the edited row and then change the color.

Name Value Size {{ rowData.Name}} {{rowData.Value}} {{ rowData.Size}} I tried using the ngstyle but all the rows are painted. I need to work with them independently.

The purpose is when the cells ends the edit pressing enter or losing the focus, check the size of the word, then if the size is correct change de row background to green or red. It is possible have more than one in the same color.


Источник: https://stackoverflow.com/questions/780 ... w-by-index
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «CSS»