Skip to content

Commit

Permalink
row selection of tables
Browse files Browse the repository at this point in the history
  • Loading branch information
Harold Garbeil authored and Harold Garbeil committed Jun 21, 2024
1 parent d2289ef commit e10eac1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 8 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,17 @@ body{
color: black;
}
.content-table tbody tr.active:nth-of-type(even) {
background-color: ffaa00;
background-color: #ffaa00;
color: yellow;
}

.content-table tbody tr.active:nth-of-type(even) {
background-color: #00ffff;
color: black;
}

.content-table tbody tr.active {
background-color: #ffaa00;
}


6 changes: 6 additions & 0 deletions weather.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,14 @@ function loadWeatherTable (events){


function tableClick (event) {
let myrows = document.querySelectorAll ('tr') ;
for (i in myrows){
myrows[i].classList ="" ;
}
let rowNum = event.target.closest('tr').rowIndex-1 ;
console.log("table clicked : "+eventsDisplayed[rowNum].properties.description) ;
myrows[rowNum+1].classList.add("active") ;
console.log(myrows[rowNum]);
alert(eventsDisplayed[rowNum].properties.description);

}
Expand Down

0 comments on commit e10eac1

Please sign in to comment.