Created
April 10, 2020 18:54
-
-
Save scottwater/ede19df0e8ed8eb34378dd03e2600a33 to your computer and use it in GitHub Desktop.
Restripe a Table's Rows
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
reStripe() { | |
const rows = [...document.getElementsByClassName("archive-row")]; | |
rows.forEach((element, index) => { | |
if (index % 2 == 0) { | |
element.classList.remove("bg-gray-50"); | |
element.classList.add("bg-white"); | |
} else { | |
element.classList.add("bg-gray-50"); | |
element.classList.remove("bg-white"); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment