3 var z = document.getElementById( 'mw-content-text' ).clientWidth,
4 x = document.querySelectorAll( '#mw-content-text table' ),
6 for ( i = x.length; i--; ) {
7 y = document.createElement( 'div' );
8 y.className = 'liberty-table-wrapper';
9 if ( x[ i ].clientWidth > z && x[ i ].parentNode.className !== 'liberty-table-wrapper' ) {
10 x[ i ].parentNode.insertBefore( y, x[ i ] );
11 y.appendChild( x[ i ] );
12 } else if ( x[ i ].clientWidth < z && x[ i ].parentNode.className === 'liberty-table-wrapper' ) {
13 x[ i ].parentNode.parentNode.insertBefore( x[ i ], x[ i ].parentNode );
14 x[ i ].nextSibling.remove();
18 window.onresize = function () {
21 window.onload = function () {