Skip to content

Instantly share code, notes, and snippets.

@mvark
Created July 7, 2024 06:29
Show Gist options
  • Save mvark/42ce4ecc5013c87143682a5f59060d8b to your computer and use it in GitHub Desktop.
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
// 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