How to select only the first td of the first colgroup table?

how to select only the first td first colgroup from table ? if i have a table with 5 columns and using 5 colgroup ?

+4
source share
1 answer

colgroup table: first-child td: first-child

From w3schools :

Note. For :first-child for work in IE, <!DOCTYPE> must be declared.

Update:

As DisgruntledGoat correctly mentions, td elements are not descendants of colgroup elements. But the first colgroup obviously always includes the first column, so this

 table tr td:first-child 

which selects the first td in each row should do this.

+17
source

Source: https://habr.com/ru/post/1309538/


All Articles