Improved HTML table rendering

fixes #17
This commit is contained in:
Sodbileg Gansukh
2024-01-03 16:17:55 +07:00
parent c060944364
commit ebc4792154
6 changed files with 36 additions and 33 deletions

View File

@@ -45,4 +45,16 @@
if (!document.body.classList.contains('home-template') && !document.body.classList.contains('post-template')) {
pagination();
}
})();
/* Responsive HTML table */
(function () {
const tables = document.querySelectorAll('.gh-content > table:not(.gist table)');
const wrapper = document.createElement('div');
wrapper.className = 'gh-table';
tables.forEach(function (table) {
table.parentNode.insertBefore(wrapper, table);
wrapper.appendChild(table);
});
})();