Fixes #6954: properly reset grid classes within tables