Properly reset borders on table cells in panels

Fixes #12447.

This makes the Less code more verbose, but it's more specific and solves the problem we have today as of v3.1. This fix also trumps #12489 and fixes #12596 (dupe of #12447).

See the change in action: http://jsbin.com/lowo/2/.