Add a button to collapse groups in tables

It would be useful to have a button to collapse all groups at once in a table.