Last active
August 21, 2019 02:56
-
-
Save mckabi/87149e73e5f94bd0ac47ccecea11a099 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll("td[colspan=full]").forEach(td => { | |
const table = td.closest("table"); | |
const columns = table.querySelector("tr").querySelectorAll("th, td"); | |
const column_count = Array.from(columns).reduce((acc, cell) => acc + (cell.getAttribute('colspan') || 1), 0); | |
td.setAttribute('colspan', column_count); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment