I'm trying to make a javascript function for a table.
I'm trying to make it so that when an element (or a table cell in this case) gets clicked other elements in the same table row disappear and the element clicked moves to the most left. There will be a slider opening up on the right showing the info about the element and such. However, I can't think of a way to do an onclick function with the elements to do the function where the elements disappear and the clicked element moves to the most left. I don't know a lot about javascript and I don't know whether there's a function that can straight up make table cells display:none or like a function that just makes the table cell colspan over other cells.
My html table:
<table id='TrendGames'>
<tr>
<td>
<img class='GameCover' src='.png'>
</td>
<td>
<img class='GameCover' src='.png'>
</td>
<td>
<img class='GameCover' src='.png'>
</td>
<td>
<img class='GameCover' src='.png'>
</td>
</tr>
</table>
Here is a script where the clicked cell will expand to take the space of the cells on the row.