is it possible to put a condition on each row of a detail table to close the row if the condition is false?
Sure. Take a look at this post here: Hide Entire Rows of Dynamic Table
It just uses a slightly modified text script to hide the entire row if one of the values in that row equals 0. The condition can be whatever you like, however.