如何从db中填充一个表选择另一个表的行?

I'm new registered user...

I read a lot this website where I always found out what I was looking for, but this time I'm stuck.

Here is my problem:

I have two tables.
First table is about litigation and second one is activity done by lawyer for that litigation.

The first is filled with the opening of the page from db(litigation).

I saw the possibility to select each row of the table using a code in javascript but the question is: when I select the row I would like to populate the second table with the activity done for that litigation.

Example:
I select the row about litigation (white vs red) and in the second table i would like to have ex. wrote letter to other part, access to Court... and so on...

How can I do it?
Thank you in advance.