Make overflowing tables scroll horizontally on mobile

This commit is contained in:
Francis Lavoie 2024-10-21 19:42:20 -04:00
parent 7a121ca58a
commit 56ed46f83f
No known key found for this signature in database
GPG key ID: 52BC55A211F19186
3 changed files with 13 additions and 2 deletions

View file

@ -718,7 +718,11 @@ table {
font-size: 16px;
}
article > table {
article > .table-wrapper {
overflow-x: scroll;
}
article table {
margin: 25px auto;
}

View file

@ -55,6 +55,9 @@ $(function() {
let text = item.innerText.replace(/</g,'&lt;').replace(/>/g,'&gt;');
$(item).html('<a href="/docs/caddyfile/matchers#syntax" style="color: inherit;" title="Matcher token">' + text + '</a>');
});
// Wrap all tables in a div so we can apply overflow-x: scroll
$('table').wrap('<div class="table-wrapper"></div>');
});
// addLinkaddLinksToSubdirectivessToAnchors finds all the ID anchors