The table structure I am working with is as follows:
<tr>
<td>
<a>
<span>
some content
</span>
</a>
</td>
<!-- td having straight span -->
<td>
<span>
some other content
</span>
</td>
</tr>
I am trying to target the span
element in every second column that does not have an anchor around it. However, my selector attempt below is incorrect because using not(a)
is not a valid method.
table td:nth-child(2) not(a) span
An ideal solution would involve only CSS, but JavaScript is also acceptable if necessary. Please advise if any improvements can be made to this query.