hugo-theme-noteworthy/assets/js/main.js
2020-02-02 11:13:02 -06:00

14 lines
419 B
JavaScript

window.onload = wrapTable();
// Wrap tables in a div so that they scroll responsively.
function wrapTable() {
const tables = document.querySelectorAll('table');
tables.forEach((table) => {
const tableWrapper = document.createElement('div');
tableWrapper.className = 'table-wrapper';
table.parentElement.replaceChild(tableWrapper, table);
tableWrapper.appendChild(table);
});
};