Skip to content

Instantly share code, notes, and snippets.

@artikus11
Last active January 11, 2022 09:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save artikus11/b31191b960a65d84e2f79899dc477131 to your computer and use it in GitHub Desktop.
Save artikus11/b31191b960a65d84e2f79899dc477131 to your computer and use it in GitHub Desktop.
Адаптивные таблицы в статьях и страницах
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