JSFiddle - React, Tailwind, and code Playground
HTML
<table>
<tr onclick={rowClick()}>
<td>{item.Name}</td>
<td>
{visitCreated}
<span>
<button
class="previewButton"
type="button" >
Preview
</button>
</span>
</td>
<td>{item.Encounters}</td>
</tr>
</table>
CSS
tr {
display: flex;
}
td {
border: 3px solid;
}
JavaScript
document.querySelector("button").addEventListener("click", function(e) {
console.log("Clicked the button");
e.stopPropagation();
e.preventDefault();
});
const rowClick = (event) => {
console.log("Clicked the row");
};