Skip to content

Commit

Permalink
improve table viewing on mobile (still not great)
Browse files Browse the repository at this point in the history
  • Loading branch information
claviska committed Aug 19, 2021
1 parent 2af3831 commit 99750b8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/assets/plugins/metadata/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,19 @@

next(content);
});

// Wrap tables so we can scroll them horizontally when needed
hook.doneEach(function () {
const content = document.querySelector('.content');
const tables = [...content.querySelectorAll('table')];

tables.map(table => {
table.outerHTML = `
<div class="table-wrapper">
${table.outerHTML}
</div>
`;
});
});
});
})();
10 changes: 10 additions & 0 deletions docs/assets/styles/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,16 @@ strong {
}

/* Tables */
.table-wrapper {
overflow-x: auto;
}

@media screen and (max-width: 1200px) {
.table-wrapper table {
min-width: 800px;
}
}

.markdown-section table {
display: table;
margin-bottom: 1.5rem;
Expand Down

0 comments on commit 99750b8

Please sign in to comment.