0

I have bunch of rows have a ID contains a number as a name like this:

<tr id="839" class="stock">
...
<tr id="2493" class="stock">
...
<tr id="4156" class="stock">
...

My CSS rule fails when I apply this:

tr[id=^['[0-9]'] {
//CSS rules goes here
}
H Aßdøµ
  • 2,925
  • 4
  • 26
  • 37

1 Answers1

1

With your example you'd be better off targeting them as

tr.stock {}

Note: IDs shouldn't start with a number

JQuery could also be an option: jQuery selector regular expressions

Community
  • 1
  • 1
enigma
  • 3,476
  • 2
  • 17
  • 30
  • Unfortunately not all rows will have the same class name. – H Aßdøµ Apr 23 '15 at 01:39
  • If you're in charge of the data generation, either ensure they all have predicable classes (different classes is fine, so long as you know what they are), or that the ids have a predictable starting string. Or you could use JQuery as I've mentioned in my answer. – enigma Apr 23 '15 at 01:44