How to Hide child table fields in standard doctype

I’ve struggled with this too. The best solution I found came from this post. Using Sagar’s example, I’ve been able to trigger on refresh() events, and hide/show columns using some logic.