I have a table implemented using a third party library. There i have something like the below code when inspecting the elements.
JavaScript
x
24
24
1
<th class="" colspan="3">
2
<span class="ant-table-header-column">
3
<div>
4
<span class="ant-table-column-title">
5
GENERAL
6
</span>
7
<span class="ant-table-column-sorter"></span>
8
</div>
9
</span>
10
</th>
11
12
13
14
<th class="" colspan="2">
15
<span class="ant-table-header-column">
16
<div>
17
<span class="ant-table-column-title">
18
INFORMATION
19
</span>
20
<span class="ant-table-column-sorter"></span>
21
</div>
22
</span>
23
</th>
24
I want to write a css class for th
where colspan="3"
. The colspan="3"
part is the only difference between the code blocks. How do i write a custom class to override the css properties from the library?
Advertisement
Answer
Use an attribute selector:
JavaScript
1
4
1
th[colspan="3"] {
2
3
}
4