Change the color of all the td inside a table class in CSS

With table.items > td you say:

Every td that is a direct child of table.items

which is never given, because there's always a <tr> between.

Try using table.items td (like Pranav Ram suggested)!


td is not the direct child of the table

table.items{ 
    border:1px solid #42536f;
}
table.items td{ 
    border-bottom:1px solid #CCC;
}

Here all td elements inside the table will select.

or

table.items{
    border:1px solid #42536f;
}
table.items>tr>td{
    border-bottom:1px solid #CCC;
}

In this case td is direct child of tr and tr is direct child of table.


table.items td or table.items > tr > td will do the required job as suggested by others already.

But, may be.. giving border-bottom to rows instead of cells.. i.e, giving it to table.items > tr will give a better look. I am not sure if that is what you are looking for :)

Tags:

Html

Css