Created
July 7, 2024 06:29
-
-
Save mvark/42ce4ecc5013c87143682a5f59060d8b to your computer and use it in GitHub Desktop.
JavaScript code to remove the last 2 columns of a 3-column table from the browser's developer console
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
// Select all table rows | |
const rows = document.querySelectorAll('table tr'); | |
// Iterate through each row | |
rows.forEach(row => { | |
// Remove the last cell twice | |
row.removeChild(row.lastElementChild); | |
row.removeChild(row.lastElementChild); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment