Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Адаптивные таблицы в статьях и страницах
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