What is the right way to display the child table of a linked document?

I have one doctype - A, which as a ‘Link’ field connected to another doctype - B.

B has also internally one child table attached to it.

I want to know what is the best way, in which whenever in the link field (which is in doctype - A), a value is selected of doctype -B, its child table can be rendered.

What is the right way to do it.