Question: How can you select the first and the last `TD` in a row?

```
tr > td[0],
tr > td[-1] {
/* styles */
}

```

Answer: 
You can use the following snippet:

```
  tr td:first-child {text-decoration: underline;}
  tr td:last-child {color: red;}

```

Using the following pseudo classes:

**:first-child** means "select this element if it is the *first child* of its parent". 

**:last-child** means "select this element if it is the *last child* of its parent". 

Only element nodes (HTML tags) are affected, these pseudo-classes ignore text nodes.
If the row contains some leading (or trailing) `th` tags before the `td` you should use the `:first-of-type` and the `:last-of-type` selectors. Otherwise the first `td` won't be selected if it's not the first element of the row. 

This gives: 

```
td:first-of-type, td:last-of-type {
    /* styles */
}

```