document.addEventListener("DOMContentLoaded", () => { for (const table of document.querySelectorAll("table")) { // wrap tables in divs to which we can apply overflow-x: scroll; table.outerHTML = `
${table.outerHTML}
`; } });