3
I want to add background
the row of a table in which one of the columns is: Value 1. I tried with the pseudo-class contains and by innerHTML
, but all without success.
Code:
table tr td [innerHTML="Valor 1"]{
background: red;
}
table tr td: contains('Valor 1'){
background: red;
}
<table>
<tr>
<td>Valor 1</td>
</tr>
<tr>
<td>Valor 2</td>
</tr>
<tr>
<td>Valor 3</td>
</tr>
</table>
- How could I use a CSS selector to select the line by column text?
- In a more general way, how could you select a element by its content?
I saw that answer a little later, thanks :)
– Marconi