Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to select only first td of first colgroup of table?

Tags:

css

how to select only first td of first colgroup of table? if i have table with 5 column and using 5 colgroup?

like image 369
Jitendra Vyas Avatar asked Dec 03 '22 12:12

Jitendra Vyas


1 Answers

table colgroup:first-child td:first-child

From w3schools:

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

Update:

As DisgruntledGoat mentions correctly, 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 every row, should do it.

like image 115
Felix Kling Avatar answered Jan 03 '23 03:01

Felix Kling