Board Thread:Support Requests - Getting Technical/@comment-3279487-20170322121943/@comment-5288784-20170323133925

There is a limited number of elements that can go into the page that will need to be realigned. Elements p, all the variants of h, ul, ol, div, nav#toc, aside, table etc. Make a test page with everything you might ever want to have in an article and see what needs correction.

Of course this is only one, pure CSS way of solving the problem. You can also use a little JS (like you did). You can also use a bot to find all such tables and wrap them inside a div on the wikitext level.