set event listeners for table cells