The following code will create a table view of countries and also added event listener to handle click.