Question: This question was inspired by [that one](https://stackoverflow.com/questions/478898/how-to-execute-a-command-and-get-output-of-command-within-c).

I've understood how to execute utils from C or C++ code. But how can we get result from some command, that doesn't just printing the result, but enters some interactive mode and works until we press `Ctrl+z`or something like this? The example of such a command is `top`.

Answer: 
So just select the third `td` in the second `tr` like that: 

```css
.MainTable tr:nth-child(2) td:nth-child(3) {
    background-color:red;
}

```

And you miss a in your html:

```
<table class="MainTable">
    <tr>
        <td>xxxx</td>
        <td>yyy</td>
    </tr>
    <tr>
        <th>AAAAA</th>
        <td>yyy</td>
        <td>ZZZZ</td>
    </tr>
</table>

```
As others have mentioned, you have serious problems with your table structure. A table has to contain one or more `<tbody>` children and a `<tr>` can't contain other `<tr>`s (unless contained in an inner table).

If I get you correctly, you want to select the second td in every row, i.e you want to disregard the `<th>` in the second row when calculating which is the "second td". This can be achieved using [`:nth-of-type()`](https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-of-type) instead of `:nth-child()`, as the former only considers elements of the same type when calculating their indices.

Note though that both `:nth-child()` and `:nth-of-type()` are only supported in IE9 and above.