tableInteraction function

Handler for table interaction events