Hi,
You should try using onRowSelect() on your table. Using this event you can get the selected row data and add your logic to change things on the page accordingly.
$w("#myTable").onRowSelect( (event) => {
let rowData = event.rowData; // {"fName": "John", "lName": "Doe"}
let rowIndex = event.rowIndex; // 2
} );