E procedere al contrario? Lasciando aperto il details con "open" e lasciando all'utente l'eventuale chiusura invece che l'apertura?
codice HTML:
<details open>
<summary>Nome container</summary>
<table>
<tr>
<td></td>
</tr>
</table>
</details>