Last active
January 3, 2016 17:09
-
-
Save nextechu/8494116 to your computer and use it in GitHub Desktop.
Using CSS class selector to select rows in a table and highlighting every other row.
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>highlighted rows</title> | |
<style> | |
table { | |
border-collapse: collapse; | |
} | |
td { | |
padding-right: 10px; | |
} | |
.highlighted { | |
background-color: #ffdc87; | |
cursor: pointer; | |
} | |
</style> | |
</head> | |
<body> | |
<table> | |
<tr class="highlighted"> | |
<td>1</td><td>11</td><td>111</td> | |
</tr> | |
<tr> | |
<td>2</td><td>22</td><td>222</td> | |
</tr> | |
<tr class="highlighted"> | |
<td>3</td><td>33</td><td>333</td> | |
</tr> | |
<tr> | |
<td>4</td><td>44</td><td>444</td> | |
</tr> | |
<tr class="highlighted"> | |
<td>5</td><td>55</td><td>555</td> | |
</tr> | |
</table> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment