update JS to handle non-cell table clicks