Fixes #8211: restore proper table grid class behavior

Needs work though—we shouldn't be setting this stuff with the attribute
selectors, but it's the easiest solution for now.
Make on previous commits