Last active
January 11, 2022 09:03
-
-
Save artikus11/b31191b960a65d84e2f79899dc477131 to your computer and use it in GitHub Desktop.
Адаптивные таблицы в статьях и страницах
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_footer', 'art_responsive_tables' ); | |
function art_responsive_tables() { | |
if ( is_singular() ) { | |
?> | |
<script> | |
jQuery(document).ready(function ($) { | |
$('article table').wrap('<div class="table-cover"></div>'); | |
}); | |
</script> | |
<style> | |
@media screen and (max-width: 1035px) { | |
.table-cover { | |
width: 100%; | |
overflow: auto; | |
margin: 0 0 1em; | |
} | |
} | |
</style> | |
<?php | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment