Nested table.

Nested table.

Hi,
I need your help to complete a function where there is a nested table. When I click on element it opens the second table and it shows all his elements and the fa-plus icon turns on fa-minus.
I would like to close the elements of the first table when I click on it and the fa-icon fa-minus turns on fa-plus.

I prepared a fiddle: http://jsfiddle.net/t763P/1141/

Thanks in advance

Tegatti