How can I apply the :nth-child() selector to all elements in an HTML document except for the last one?
Is this code snippet valid? =
td:nth-child:not(last-child){
//Some css//
}
I am using the text-overflow:ellipsis property to hide overflow from table cells within <td>
elements.
I have successfully applied this effect to even and odd children of the <td>
element. Now, I want to apply it to all <td>
elements except the last child of the table.
I tried the following:
.table-condensed tbody tr td:nth-child:not(last-child) a
{
white-space: nowrap;
text-overflow: ellipsis;
width: 150px;
display: block;
overflow: hidden;
}
However, this did not work as expected. Do you have any suggestions on how to achieve this effect?