JSFiddle - React, Tailwind, and code Playground
HTML
<div class="content">
<table>
<tr>
<td> content about the image </td>
<td> <div id="<%= content[:lable].delete(' ')%>" class="view"> VIEW-IMAGE</div></td>
</tr>
<tr>
<td>content about the image</td>
<td><div id= "<%= content[:lable].delete('')%>" class="view">VIEW-IMAGE</div></td>
</tr>
</table>
</div>
CSS
.view{
border: 1px solid #e0e0e0;
padding: 7px;
text-align: center;
background-color: #F9F9F9;
font-weight: bold;
font-size: 13px;
color: #3C3D3E;
font-family: Arial;
cursor: pointer;
}
JavaScript
$('.view').click(function (event){
var image = $(this).id
$(this).css("background", "url(image.jpg) no-repeat");
});